Closed blackshot closed 3 years ago
This PR enables the useImmer hook to be used as a normal useState passing a value as argument with still allowing the user to use the immer feature.
const [state, setState] = useImmer([]); // normal setState usage setState(["this", "is", "the", "new", "state"]); // or immer usage setState( draft => { draft.push("my new item") });
Thanks for the PR! LGTM, but would you mind updating the documentation as well? Thanks!
Published as 0.5.0
This PR enables the useImmer hook to be used as a normal useState passing a value as argument with still allowing the user to use the immer feature.