Skip to content

Instantly share code, notes, and snippets.

@jahooma
Created October 9, 2019 06:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jahooma/33c8407cf265fb749ad43fe91ec6150c to your computer and use it in GitHub Desktop.
Save jahooma/33c8407cf265fb749ad43fe91ec6150c to your computer and use it in GitHub Desktop.
A wrapper component that arranges children in a tree structure for faster and smarter updates.
export const FastChildren = memo((props: {
children: JSX.Element[]
}) => {
const changes = useChanges(props.children)
const tree = useChildrenTree(changes)
return <ChildrenTree tree={tree} />
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment