Skip to content
Discussion options

You must be logged in to vote

After playing around with the code you've provided, I'm pretty sure the main problem is that your context prop is not memoized. Internally, context is not granularly memoized like controlClassnames, controlElements, and translations, so you have to memoize the entire object yourself. Probably just this:

const context = useMemo(() => ({ showLabels, showBranches }), [showLabels, showBranches]);

Let me know if that works!

I'll investigate the demo perf later. Thanks for the heads up.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@hyaeco
Comment options

@jakeboone02
Comment options

@hyaeco
Comment options

@jakeboone02
Comment options

Answer selected by hyaeco
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants