troch / reinspect

Use redux devtools to inspect useState and useReducer :mag_right:
MIT License
424 stars 24 forks source link

Crash with useState when setState(null) #22

Open toniocodo opened 5 years ago

toniocodo commented 5 years ago

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.

cherepanov commented 5 years ago

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

mrluc commented 4 years ago

So is this dead?