-
Notifications
You must be signed in to change notification settings - Fork 49.2k
Closed
Closed
Copy link
Description
React version: 0.0.0-experimental-94c0244ba
Steps To Reproduce
Mutating the external source during the initial render before subscribe throws error.
https://codesandbox.io/s/usemutablesource-7nbs6?file=/src/App.js
- Navigate to the above code sandbox
- Click on the Mutate button. Final Value is rendered without any error. (Success Mode)
- Toggle to Error Mode and click on the Mutate button again.
- Error thrown (and the UI is rendered with the Final Value when run from vscode)
Note: In our actual codebase (private), we are seeing this error at different instances e.g. component getting updated due to
setState
call inuseLayoutEffect
etc.
The current behavior
Seeing errors in development build.
The expected behavior
These errors thrown by useMutableSource should not showup on the UI and not passed to the error boundary as the component is eventually re-rendered with the latest state without any error.