Итак, я попытался использовать MobX с реакцией, но не могу понять, почему ввод не обновляет свое значение.
Это код, который я написал до сих пор:
@observer(['recipeStore'])
class App extends Component {
render() {
return (
<input type="text" value={this.props.recipeStore.og} onChange={(e) => {this.props.recipeStore.og = e.target.value}}/>
);
}
}
class RecipeStore {
@observable og;
@observable style;
constructor() {
this.og = 1;
this.style = {og_low: 1, og_high: 1, fg_low: 1, fg_high: 1, abv_low: 1, abv_high: 1};
}
@computed get fg() {
if (!this.og) return '';
return (((this.og - 1) * 0.25) + 1).toFixed(3);
}
@computed get abv() {
if (!this.og) return '';
return ((this.og - this.fg) * 131).toFixed(1);
}
}
const recipeStore = new RecipeStore();
ReactDOM.render(
<Provider recipeStore={recipeStore}>
<App />
</Provider>,
document.getElementById('root')
);
recipeStore.og
и вы увидите, что значение обновилось. Попробуйте показать весь соответствующий код в вопросе вместо ссылки на внешний ресурс. - person Tholle   schedule 08.09.2016