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
onClick
must be a functionthis.setState
expects an object, which will be merged with the state
so the part where you set selected
in your state must be
you use an undefined variable in your filter (selected
),
you have to use .filter(({tableName}) => tableName === this.state.selected)
instead