Skip to content

Commit

Permalink
fix(CSwitch): A component is changing an uncontrolled input of type c…
Browse files Browse the repository at this point in the history
…heckbox to be controlled

- undefined `checked` prop causes a warning
  • Loading branch information
xidedix committed May 8, 2020
1 parent 6be35c6 commit 955370e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/CSwitch.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,14 @@ const CSwitch = props => {
className={inputClasses}
type="checkbox"
onChange={change}
checked={isChecked}
checked={!!isChecked}
{...attributes}
ref={innerRef}
/>
<span
className="c-switch-slider"
data-checked={labelOn}
data-unchecked={labelOff}
></span>
<span className="c-switch-slider"
data-checked={labelOn}
data-unchecked={labelOff}
/>
</label>
)
}
Expand Down

0 comments on commit 955370e

Please sign in to comment.