Closed AndiF closed 5 years ago
Also encountering this
This is called observedBits
which is undocumented and unstable.
Let's say we have a state like: { counter1: 0, counter2: 0 }
and we useGlobalState('counter1')
in a component "A". We want to avoid rendering A when only counter2 is updated, and that's how observedBits
is currently used. It is supposed to be super efficient.
Now, since React 16.8 clearly warns the use of this, I'm wondering what I should do with it...
https://github.com/facebook/react/pull/14729#issuecomment-461279892 This is exactly the same here. Cc @gaearon @benwiley4000
Ben and Dan, thanks so much! I will look into it.
Published v0.7.0.
With React 16.8.1 I noticed the following error log:
Warning: useContext() second argument is reserved for future use in React. Passing it is not supported.
I am not sure about the intention of the 2nd parameter here: const state = useContext(context, 1 << index); but I guess it can simply be removed ?