This repository was archived by the owner on Jan 23, 2024. It is now read-only.

Description
Subject
createStylesContext
Description
PR #1397 updated the useMultiStyleConfig() documentation to use the new createStylesContext() API rather than the old and deprecated global StylesProvider.
There are two problems with the current state of the documentation:
- While
<Menu /> is using the new createStylesContext(), <MenuItem /> is still using the global useStyles(). This does not work. (Throws error that child is not in a <StylesProvider />
<Menu /> is calling createStylesContext() from inside the react component. This is causing StylesProvider to be a new element on every render, which will cause children to hard remount (In my case all DOM nodes are being fully removed and re-added each time the parent re-renders.
Documentation should have createStylesContext() moved outside of the parent component, with the child component using the use hook returned by createStylesContext() rather than the global useStyles()