I am learning react and struggling to get a second dropdown to populate based on which option is clicked from first dropdown.
I have included my code below.
I
The syntax in your call to setState
in your event handler looks incorrect.
You also make try to reference this.state.selected
in your .filter
condition without the path to the variable (this.state
)
// The .setState method expects an object to be passed to it rather
// than an expression that mutates the state directly
// Pass it an object containing the properties you want to change,
// ensure your use colon (':') rather than equals sign ('=') to set property: