arnthor3 / react-bootstrap-toggle

Bootstrap-toggle without the JQuery dependencies
Other
54 stars 16 forks source link

Does not support FontAwesomeIcons in labels #34

Closed JokerGrizzly closed 4 years ago

JokerGrizzly commented 5 years ago

image

This error is returned when a font awesome icon is placed in labels. If it's the error is thrown when you click on the button. If it's the error is thrown at page loading.

pfischer1290 commented 5 years ago

Hi @nicoger, can you provide your Code? Most likely your Implementation is not correct.

If you insert Font-Awesome like that, its working for me:

import Toggle from 'react-bootstrap-toggle';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';

<Toggle on={<FontAwesomeIcon icon={faExclamationTriangle} />} [...]/>