I am using React in my project and having trouble getting the Wi-Fi Signal Strength Icon next to the networks name. (These two fields come from an external endpoint.)
The error I'm getting in the console (f12) would be this: validateDOMNesting(...): cannot appear as a child of . Does anyone know how to solve it in the code, so that the Icon appears within the select options?
Code:
{wifiNetwork.map((option, index) => (
<option key={index} value={option.network_name}>
{option.network_name}
{option.signal_strength >= 0 && option.signal_strength < 25 ? (
<BiWifi0/>
) : (
<BiWifi/>
)}
</option>
))}
I need to do Put the Signal Strength Icons Wifi next to the network name:
It only works for now if I put a String in place of the SVG, because according to the suggestion of this topic: Suggest, the option tag only accepts plain text, but they did not make clear a possible alternative. Would it be styling a proper CSS for these Icon?
Any suggestions on how I can resolve this in code?