You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
useState re-renders the function with a short timeout
I have made a very small and simple TODO component with both React Class and React Function component. I wrote a few test to each (NOTE: tests are exactly the same for the class component and function component)
When running the tests for the function component it looks like that the render of the function is called with a short timeout(The function component uses useState in it)
A working example can be found in this repo: https://github.com/KirilVelichkov/react-hooks-bug
To see the bug go to todo.test.js and un-comment line 62. To see how i got it fixed un-comment the below lines.
This is reproducible on both Windows 10 and macOS High Sierra 10.13.6
Node version - 11.0.0
NPM version - 6.4.1
The text was updated successfully, but these errors were encountered:
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
useState re-renders the function with a short timeout
I have made a very small and simple TODO component with both React Class and React Function component. I wrote a few test to each (NOTE: tests are exactly the same for the class component and function component)
When running the tests for the function component it looks like that the render of the function is called with a short timeout(The function component uses useState in it)
A working example can be found in this repo: https://github.com/KirilVelichkov/react-hooks-bug
To see the bug go to todo.test.js and un-comment line 62. To see how i got it fixed un-comment the below lines.
This is reproducible on both Windows 10 and macOS High Sierra 10.13.6
Node version - 11.0.0
NPM version - 6.4.1
The text was updated successfully, but these errors were encountered: