How do I create a dynamic variable name in React?
Use []
brackets like this
this.setState({["level" + (selectedItem.Level+1)]: FilteredListFromClick})
Prakash's solution works given an advanced enough EcmaScript version.
An older-style and (IMHO) slightly more readable solution is to build the map outside and pass it in.
const newState = {}
newState["level" + selectedItem.Level+1] = FilteredListFromClick
this.setState(newState)