pretty-checkbox icon indicating copy to clipboard operation
pretty-checkbox copied to clipboard

Works with react-icons?

Open webbygregg opened this issue 8 years ago • 2 comments

I have been trying to get the checkboxes to work with react-icons which uses SVGs

This is my code:

<div className="pretty p-svg p-curve">
    <input type="checkbox" />
    <div className="state p-success">
      <FaCheck />
      <label>Recurring</label>
    </div>
  </div>

but it's not working, is it compatible?

webbygregg avatar Jan 08 '18 05:01 webbygregg

Hi @webbygregg ,

sorry for the late response. I havent tested with react. But will try and get back to you soon.

lokesh-coder avatar Feb 21 '18 18:02 lokesh-coder

React works best if the input is "controlled" and so, you'll need to program the state and the behavior...

<input type="checkbox"  
                checked={this.state.checked}  
                onClick={e=>{
                  this.setState({checked: !this.state.checked});
                }}
                />

*this.state.checked assumes you only have one checkbox in your component. You'll probably want a richer state variable.

chadsteele avatar Nov 15 '18 17:11 chadsteele