I would like to declare many variables into the state
. How to use dynamic method to do that?
For example:
constructor(props) {
super(props);
this.state =
{
test1: this.props.navigation.state.params.rowData.test1,
test2: this.props.navigation.state.params.rowData.test2,
.........
test50: this.props.navigation.state.params.rowData.test50
}
}