How to use the @times-components/markup-forest.render function in @times-components/markup-forest

To help you get started, we’ve selected a few @times-components/markup-forest examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github newsuk / times-components / packages / article-skeleton / src / article-skeleton.js View on Github external
onRelatedArticlePress={onRelatedArticlePress}
          onTopicPress={onTopicPress}
        />
      
    ),
    []
  );

  const fixedContent = useMemo(
    () => [...fixup(isTablet, content), { name: "footer" }],
    [content, isTablet]
  );
  const images = fixedContent.filter(node => node.name === "image");

  const dropcapsDisabled = isDropcapsDisabled(data);
  const renderChild = render(renderers({ dropcapsDisabled, ...props, images }));
  // eslint-disable-next-line react/prop-types
  const Child = useCallback(
    ({ item, index }) => (
      
        
          {item.name === "footer"
            ? footer
            : renderChild(item, index.toString(), index)}
        
      
    ),
    [footer]
  );

  // FIXME: remove this when ios memory leaks are resolved
  const Scroller = React.useCallback(

@times-components/markup-forest

Utility functions for traversing The Times' AST

BSD-3-Clause
Latest version published 7 months ago

Package Health Score

80 / 100
Full package analysis