Observe Switch component
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user