reinspect icon indicating copy to clipboard operation
reinspect copied to clipboard

Crash with useState when setState(null)

Open toniocodo opened this issue 5 years ago • 2 comments

When using useState to track state in dev tool, passing "null" as argument to state setter will result in error in reinspect: image

const App = () => {
  const [queryId, setQueryId] = useState('', 'app/queryId');
  
  useEffect(() => {
    if (queryId) {
      setQueryId(null);
    }
  }, [queryId]);

  return (<div>App</div>)

};

This is probably due to the fact that reinspect fakes a reducer call with useState.

toniocodo avatar Sep 24 '19 09:09 toniocodo

didn't get how it supposed to work and made a simple fix #23

cherepanov avatar Oct 22 '19 04:10 cherepanov

So is this dead?

mrluc avatar Jan 09 '20 19:01 mrluc