Closed davej closed 6 years ago
Hey @davej! Thanks for bringing this up. In general I don't think react-copy-write should replace regular React state. One of the best things about it is that you can use it alongside other stateful React components when necessary.
If you'd like to use the mutate
method to update local state, try just importing immer
directly. This is what RCW uses internally, and mutate
is just a small wrapper around it.
Hope that helps!
Is it possible to use
react-copy-write
to read/write local component state rather than from the Provider context?A possible API might look like this?