-
-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stage is killing the Context #349
Comments
So const Canvas = () => {
return (
<ThemeContext.Consumer>
{value => (
<Stage width={window.innerWidth} height={window.innerHeight}>
<ThemeContext.Provider value={value}>
<Layer>
<ThemedRect />
</Layer>
</ThemeContext.Provider>
</Stage>
)}
</ThemeContext.Consumer>
);
}; |
I was checking for this issue and saw that other libraries use the while react-konva/src/ReactKonvaCore.js Lines 89 to 99 in f1de915
to render the stage into the div given by the ref. Do I understand this correctly? |
Maybe this implementation would help: |
@ribx how it may help? |
I thought it does. I found it only because of this PR: https://github.com/michalochman/react-pixi-fiber/pull/84/commits But maybe things changed again in So I will go for replicating all my providers. Thanks. |
This is a known issue of react-konva, see eg. konvajs/react-konva#349 konvajs/react-konva#311 Revert some changes made to drawControl and boardControl reducers.
Update on this issue. From |
I've just tried it out with Not sure this is the right place for this but just in case others are doing the same as me: I originally bridged into the stage to use a customization menu from outside the stage but once I had enough elements inside the stage (~15 1000x500px partly transparent images with RGB filters) the latency became noticeable (since every component in the stage would run on each state update). So I moved the menu inside the stage and separated it out so I could wrap each part and the layers it interacts in a separate context (hence having to bridge into html wrappers). This way makes organizing the menu a pain since each part is inside a separate html wrapper but the performance is obviously much better. |
I'm developing a project using provider pattern. So I'm passing informations between my components using context.
Then, at
Map
component I have this:And for some unknown reason, I have a problem at
TilemapLayer
because the context didn't arrive at this component:Debugging it I replaced the
Stage
todiv
at return ofMap
:And with this code, I can use
useContext(VisionContext)
atTilemapLayer
. I tried replacingdiv
for others components as well, and it's worked.Because of it, I think that
Stage
is killing the Context - what is a bug.The text was updated successfully, but these errors were encountered: