I have two questions - one about React & Redux and one about es6.
- Question: I am totaly new to React and Redux. I feel good with React but Redux is really difficult. I have a basic question how I should generally go further. I use the Material-UI Framework in my Test-Project and there I use the component. This component works with the onChange event and then it updates the this.state.value to display this value. But when I use Redux then I have to store everything in my store right? So is it wrong to store the current value of the in the this.state.value property?
2.Question: This snipped doesn't work, it tells me 'Unexpected token' in this Line:
handleChange = (event, index, value) => {
this.setState({value});
};
///////////////////////////////////////////////////////////////////////////
export default class AddSterbefallForm extends React.Component {
constructor(props) {
super(props);
this.state = {value: 10};
}
handleChange = (event, index, value) => {
this.setState({value});
};
render() {
return (
<SelectField value="{this.state.value}" onChange {this.handleChange}>
<MenuItem value="Herr" key="m" primaryText="Herr" />
<MenuItem value="Frau" key="w" primaryText="Frau" />
</SelectField>
);
}
}