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
{{ message }}
This repository has been archived by the owner on Dec 31, 2020. It is now read-only.
Expected result: two buttons, If I click button 1 text changes to "Loading" and console logs "render,true"
Actual result: two buttons, If I click button 1 text of button 1 and button 2 changes to "Loading" and console logs "render,true" twice. If I click button 1 again both buttons are re-rendered and text changes to "Click me".
Workarounds:
remove the export statement from the class definition
use extendObservable in the constructor instead of observable
Im using Typescript 1.8.9 (with experimentalDecorators set to true), mobx 2.0.4 and mobx-react 3.0.3
The text was updated successfully, but these errors were encountered:
otbe
changed the title
One state for multiples instances
Shared state for multiples instances of component
Apr 2, 2016
You are right. This works as expected.
I have played around for while with your repo and I can reproduce the error if I add "react-hot-loader" for HMR support to the webpack chain. Switched to "react-hmre" babel preset for HMR.
Hi,
I have a little component that wraps a button and shows up a "Loading" text if you click the button.
Something like that:
Expected result: two buttons, If I click button 1 text changes to "Loading" and console logs "render,true"
Actual result: two buttons, If I click button 1 text of button 1 and button 2 changes to "Loading" and console logs "render,true" twice. If I click button 1 again both buttons are re-rendered and text changes to "Click me".
Workarounds:
Im using Typescript 1.8.9 (with experimentalDecorators set to true), mobx 2.0.4 and mobx-react 3.0.3
The text was updated successfully, but these errors were encountered: