How can I add icons in select dropdown?
My code is:
import React, { Component } from 'react';
import Icon from '@mdi/react'
import { mdiFormatAlignLeft } from '@mdi/js';
import { mdiCheckboxMarked } from '@mdi/js';
import { IoMdRadioButtonOn } from 'react-icons/io';
class AddNewQuestion extends Component {
render() {
return (
<div>
<select>
<option value='multiple'><Icon path={mdiCheckboxMarked} /> Multiple choice</option>
<option value='single'><IoMdRadioButtonOn /> Single choice</option>
<option value='open'><Icon path={mdiFormatAlignLeft} /> Open question</option>
</select>
</div>
)
}
}
Instead of the icon, I get [object Object].
I tried to put MD icon as a webfont, as described here: https://dev.materialdesignicons.com/getting-started/webfont but I also get [object Object].
Any ideas how to do it?