From 1b5e0ed6e6c0f2ce796c700308363ce42e24ff34 Mon Sep 17 00:00:00 2001 From: Arlen Yu Date: Sun, 22 Apr 2018 10:01:34 -0400 Subject: [PATCH] Allow defaultChecked to be string as well as boolean --- src/Checkbox/macOs/index.js | 2 +- src/Checkbox/windows/index.js | 2 +- src/Radio/macOs/index.js | 2 +- src/Radio/windows/index.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Checkbox/macOs/index.js b/src/Checkbox/macOs/index.js index cae1c93a..1d81df0e 100644 --- a/src/Checkbox/macOs/index.js +++ b/src/Checkbox/macOs/index.js @@ -22,7 +22,7 @@ class Checkbox extends Component { constructor(props) { super(); this.state = { - checked: props.defaultChecked === true, + checked: !!props.defaultChecked === true, transition: true }; } diff --git a/src/Checkbox/windows/index.js b/src/Checkbox/windows/index.js index e775c305..2403f40d 100644 --- a/src/Checkbox/windows/index.js +++ b/src/Checkbox/windows/index.js @@ -29,7 +29,7 @@ class Checkbox extends Component { constructor(props) { super(); this.state = { - checked: props.defaultChecked === true + checked: !!props.defaultChecked === true }; } diff --git a/src/Radio/macOs/index.js b/src/Radio/macOs/index.js index 1f167b19..a0c1e33a 100644 --- a/src/Radio/macOs/index.js +++ b/src/Radio/macOs/index.js @@ -22,7 +22,7 @@ class Radio extends Component { constructor(props) { super(); this.state = { - checked: props.defaultChecked === true, + checked: !!props.defaultChecked === true, transition: true }; } diff --git a/src/Radio/windows/index.js b/src/Radio/windows/index.js index e2cbc018..b20afe41 100644 --- a/src/Radio/windows/index.js +++ b/src/Radio/windows/index.js @@ -38,7 +38,7 @@ class Radio extends Component { constructor(props) { super(); this.state = { - checked: props.defaultChecked === true + checked: !!props.defaultChecked === true }; }