Closed kampiu closed 9 months ago
The warehouse depends on use-context-selector, which depends on [use-context-selector](https://github.com/dai-shi /use-context-selector) removes the Consumer when processing the Context. Why is this?
You get it. Yes, it's not supported.
Hooks don't work with class components anyway, and we don't want to complicate things. We recommend wrapping class components with function components.
the Stage component will have context isolation
Yes, bridging is required for such cases:
你懂了。是的,不支持。
不管怎样,钩子不能与类组件一起使用,我们不想让事情变得复杂。建议我们用组件函数包装类组件。
具有上下文隔离的阶段组件
是的,这种情况下需要桥接:
OK, I'll give it a try, thanks for the suggestion
In some scenarios, context.Consumer in React needs to be used. Currently, the plug-in is not exposed to the outside world. What is the reason?
When using konva and konva-react, due to the design of konva, the Stage component will have context isolation, and a common solution based on redux is given:
https://github.com/konvajs/react-konva?tab=readme-ov-file#usage-with-react-context
It is not ruled out that there are other plug-ins or frameworks that need to solve the same scenario in this way.