-
-
Notifications
You must be signed in to change notification settings - Fork 636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
componentDidUpdate inferno-mobx prevProps are equal to this.props #1494
Comments
Hi @TotallWAR Can you create simple demo to reproduce the issue please. For example JsFiddle https://jsfiddle.net/2nm1kqct/ or github repo. |
@Havunen i created: https://codesandbox.io/s/inferno-mobx-props-not-updating-un8gy Clicking |
I checked your codesandbox example and Inferno core -wise this is working correctly. Because Questionnaire Component does forceUpdate so there are no new props its just rendering again. Whether this is expected behavior from inferno-mobx I dont know. By wrapping all components inside HoC we could achieve the props changing. We need to check how React / React-mobx does it to verify the correct behavior. |
Observed Behaviour
Prevprops.state.someValue.var in inferno component method componentDidUpdate are equal to this.props.state.someValue.var
Expected Current Behaviour
Props are should be different
Inferno Metadata
macOS
Chrome
I use inferno-mobx.
packages' versions:
"inferno": "^7.3.2",
"inferno-clone-vnode": "^7.3.2",
"inferno-component": "^7.3.2",
"inferno-hydrate": "^7.3.2",
"inferno-loadable": "^5.4.3",
"inferno-mobx": "^7.3.2",
"inferno-router": "^7.3.2",
"inferno-server": "^7.3.2"
"mobx": "^5.14.0"
I tried to create full copy of object in state and set new value into it like in react-redux but it didn't help.
// class which update state
// stores/questionnaire.js
// my component
// my initial state class
The text was updated successfully, but these errors were encountered: