Skip to content
Advertisement

React TypeScript select field does not display

I got useState with a list of strings (currencies symbols like “USD”, “EUR” etc.)

JavaScript

And I need to display it into the select field, right now I’m using this:

JavaScript

It says the bug is in {symbols.map((symbol) =>..., but I have no idea what to do with it. Full Error:

JavaScript

Advertisement

Answer

  1. add return before <option value={symbol}>symbol</option>

or

  1. delete {} wrapped outside <option value={symbol}>symbol</option>
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement