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
import { extendObservable, observable, set } from 'mobx';
/**
* This is our state, we update it
* using the methods from other stores
*/
export default class State {
constructor(state) {
// init state obj
extendObservable(this, {
questionnaire: {
stepNumber: 0,
completedSteps: 0
}
});
// set current state
set(this, state);
}
}
import Questionnaire from '../stores/questionnaire';
export default state => {
return {
state,
store: {
questionnaire: new Questionnaire(state),
}
};
};
The text was updated successfully, but these errors were encountered:
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: