From 459c393154df7133ee67f7205e02261ae41127fd Mon Sep 17 00:00:00 2001 From: Jori Lallo Date: Wed, 6 Jul 2016 21:37:23 -0700 Subject: [PATCH] Observe Switch component --- src/components/Switch.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/Switch.js b/src/components/Switch.js index 936bd1fca..dbf8c64b8 100644 --- a/src/components/Switch.js +++ b/src/components/Switch.js @@ -1,11 +1,12 @@ -import React from 'react' -import { Base } from 'rebass' +import React from 'react'; +import { Base } from 'rebass'; +import { observer } from 'mobx-react'; /** * Binary toggle switch component */ -const Switch = ({ +const Switch = observer(({ checked, ...props }) => { @@ -55,7 +56,7 @@ const Switch = ({
) -} +}); Switch.propTypes = { /** Sets the Switch to an active style */ @@ -66,4 +67,4 @@ Switch.contextTypes = { rebass: React.PropTypes.object } -export default Switch \ No newline at end of file +export default Switch;