score:1

Accepted answer

Probably I would add default initial value to useState as instead of '':

const [category, setCategory] = useState(categoryList[0]);

Or maybe if the data is coming dynamically then calling setCategory() with the value from the API result what you would like to have as default.

I hope this helps!


Related Query

More Query from same tag