How to update Canvas props? #190
Replies: 2 comments 1 reply
-
Mhm there seems to be a bug there. 🤔 But I have two workarounds for you: In Codesandbox 1 we're relying on the fact that ColumnLayout only has one Column as its descendant. Everytime The workaround in Codesandbox 2 is much easier and easy to miss. We rely on the fact that React re-renders when the Maybe there is a more obvious solution, or maybe @prevwong knows why the fix in #48 isn't working anymore. |
Beta Was this translation helpful? Give feedback.
-
I attempted to add a fix in #191 but that's not final yet, because this results in one too many renders. Will have to look into that again. |
Beta Was this translation helpful? Give feedback.
-
I am trying to update the props passed to Canvas from a parent component.
I read this issue #31 and the PR that fixes it #48 . I am trying to do something like the example in the PR. But I don't see the props cascading to the Canvas.
I created this codesandbox - https://codesandbox.io/s/craft-column-layout-current-version-forked-rfrn4?file=/src/App.tsx . In App.tsx, see line 64 where the canvas is being rendered and line 31 where the count is being rendered.
I was expecting the count to update but it does not. Is this possible?
Thanks !!
Beta Was this translation helpful? Give feedback.
All reactions