diff --git a/packages/switch/index.tsx b/packages/switch/index.tsx index e8e5dcef2..900b9ecc1 100644 --- a/packages/switch/index.tsx +++ b/packages/switch/index.tsx @@ -35,10 +35,10 @@ function Switch( const switchStyle = { fontSize: size, - backgroundColor: value ? activeColor : inactiveColor + backgroundColor: checked ? activeColor : inactiveColor }; - const loadingColor = value ? activeColor || BLUE : inactiveColor || GRAY_DARK; + const loadingColor = checked ? activeColor || BLUE : inactiveColor || GRAY_DARK; function onClick() { if (!disabled && !loading) { diff --git a/packages/switch/test/__snapshots__/index.spec.js.snap b/packages/switch/test/__snapshots__/index.spec.js.snap new file mode 100644 index 000000000..d2a276311 --- /dev/null +++ b/packages/switch/test/__snapshots__/index.spec.js.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`inactive-color prop 1`] = ` +