We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 580e2f5 commit 8131de1Copy full SHA for 8131de1
packages/react-devtools-shared/src/devtools/views/hooks.js
@@ -264,11 +264,11 @@ export function useSubscription<Value>({
264
getCurrentValue: () => Value,
265
subscribe: (callback: Function) => () => void,
266
|}): Value {
267
- const [state, setState] = useState({
+ const [state, setState] = useState(() => ({
268
getCurrentValue,
269
subscribe,
270
value: getCurrentValue(),
271
- });
+ }));
272
273
if (
274
state.getCurrentValue !== getCurrentValue ||
0 commit comments