Observe Switch component

This commit is contained in:
Jori Lallo
2016-07-06 21:37:23 -07:00
parent 49c79451df
commit 459c393154

View File

@@ -1,11 +1,12 @@
import React from 'react' import React from 'react';
import { Base } from 'rebass' import { Base } from 'rebass';
import { observer } from 'mobx-react';
/** /**
* Binary toggle switch component * Binary toggle switch component
*/ */
const Switch = ({ const Switch = observer(({
checked, checked,
...props ...props
}) => { }) => {
@@ -55,7 +56,7 @@ const Switch = ({
<div style={sx.dot} /> <div style={sx.dot} />
</Base> </Base>
) )
} });
Switch.propTypes = { Switch.propTypes = {
/** Sets the Switch to an active style */ /** Sets the Switch to an active style */
@@ -66,4 +67,4 @@ Switch.contextTypes = {
rebass: React.PropTypes.object rebass: React.PropTypes.object
} }
export default Switch export default Switch;