modif on toggles.js to create a react component

To create a react component we only need the toggle to dispatch a customEvent listened in the componentDidMount method of our component. When a toggle event is fired, a callback should update some state and then this component should reflect the new state by the addition (or not) of the active class