Replies: 1 comment
-
We are happy with the default being |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If user doesn't explicitly configure the
applyClassersTo
prop, then the top level ToolkitProvider will default toroot
, nested Providers will default toscope
. I think the default should always bescope
, here's why:In
root
mode, classnames are applied to the document element in auseLayoutEffect
hook. If any other components in the app also rely on a useLayoutEffect hook, these will execute first, it's bottom-up order. If any of these are using the useLayoutEffect to measure rendered items (a very common use case), they will be doing so, first time around, before the theme classnames have been applied to the document element so no theme variables will be in scope and measurements are highly likely to be wrong.If there is a single child under the root Provider, I'd suggest that the default would be to apply the theme classnames there.
Beta Was this translation helpful? Give feedback.
All reactions