Replies: 1 comment
-
ReactNode can't be proxified. Please use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm currently making the switch in my mid-scale project from React's useContext to a simple centrally managed store library. Currently, Valtio has my preference because updating deeply nested objects using the immutable pattern is too much work. Hence, I need to either use immer or something like Valtio.
My issue is that I seemingly can't get it to work. Consider the following:
This system is not perfect but it allows whoever consumes my library/framework to open modals by getting a snapshot of the proxy and calling "open". My issue arises when I try to display it like this:
I get this obscure error on
{modal.content}
:Note that if I add a method in the proxy like "map" then it works but I have to subscribe to the list even though I don't use it, otherwise my modal container does not update. In my opinion, this is a code smell.
Beta Was this translation helpful? Give feedback.
All reactions