davidmfoley / enzyme-adapter-react-16-with-shallow-effects

Enzyme adapter with support for effects with shallow rendering
MIT License
3 stars 1 forks source link

setState in useEffect causes rerender #3

Open gradyzhu opened 3 years ago

gradyzhu commented 3 years ago

current behavior:

expectation:

useEffect(() => {
  setState((state) => {
    const newState = state + 1;
    return newState;
  });
}, [])
davidmfoley commented 3 years ago

Hey there -- I'm glad you're finding some use from this. I stopped working on this project in favor of isolate-components and isolate-hooks so I probably won't get a chance to fix this issue, unfortunately.

gradyzhu commented 3 years ago

appreciate the quick feedback, thanks i'll check it out!