Closed vesparny closed 6 years ago
If you need to update state in a lifecycle, using createMutator
is definitely the recommended way to do it!
Assuming I create my State instance in a top-level component, should I pass createMutator
as a prop to inner components?
Hi, what is the recommended way to create the state and re-use it across components in different files? Imagine in your app.js you create the state
How do I use
State
andProviders
in connected components?I worked on a lib called statty and one of the most annoying thing is to create a wrapper component when you need the
update
in lifecycle hookscreateMutator
seems meant to solve this pain, and I wonder what is the suggested way to use it in multiple components :)Thanks