-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
🎁 mobx-react-liteIssue or PR related to mobx-react-lite packageIssue or PR related to mobx-react-lite package🐛 bug👓 needs investigation
Description
Intended outcome:
No error occurs while update script and fast refresh triggered while using wrapped observer component
Actual outcome:
Rendered fewer hooks than expected occurs while using Fast Refresh and wrapped observer component
How to reproduce the issue:
I have created codesandbox : https://codesandbox.io/s/react-fast-refresh-test-forked-3ksts
- After codesandbox load completely
- Just copy paste script like below to trigger fast refresh
// JUst copy React.useEffect
React.useEffect(() => {
console.log("a");
}, []);
// Paste here
React.useEffect(() => {
console.log("a");
}, []);
// Paste here again
to
// JUst copy React.useEffect
React.useEffect(() => {
console.log("a");
}, []);
// Paste here
React.useEffect(() => {
console.log("a");
}, []);
// Paste here again
React.useEffect(() => {
console.log("a");
}, []);
And error will trigger like below screenshot
And redo it again without "observer" and no errors will occurs. I think this problem still same with old problem mobxjs/mobx-react-lite#226
Note : I use observer wrapper in purpose to reproduce this bugs and provide simple proof
Versions
mobx : 6.0.4 latest
mobx-react-lite : 3.1.6 latest
Metadata
Metadata
Assignees
Labels
🎁 mobx-react-liteIssue or PR related to mobx-react-lite packageIssue or PR related to mobx-react-lite package🐛 bug👓 needs investigation