You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using hooks inside nested Konva components, the hooks appear to lose the correct scope or context.
For a specific example, I am using some hooks from Material UI.
constMyComponent=()=>{consttheme=useTheme();// Prints the correct theme object I have configured in my appconsole.log(theme);return(<Stage><Layer><NestedComponent/></Layer></Stage>);};constNestedComponent=()=>{consttheme=useTheme();// Prints the default theme, ignoring the config I have in the rest of the appconsole.log(theme)return<Texttext="My Text"x={0}y={0}/>;};
This is not exclusive to Material UI hooks. I run into a similar error when using other libraries. It may be related to this issue.
The text was updated successfully, but these errors were encountered:
react-konva is losing the context information from the tree above. At the current moment, I don't know any ways to automatically pass contexts into nested components. You have to "bridge" them manually.
React Konva:
16.10.1-0
React:
16.10.2
When using hooks inside nested Konva components, the hooks appear to lose the correct scope or context.
For a specific example, I am using some hooks from Material UI.
This is not exclusive to Material UI hooks. I run into a similar error when using other libraries. It may be related to this issue.
The text was updated successfully, but these errors were encountered: