Last active
March 25, 2020 21:11
-
-
Save rubenmarcus/fae97b192b20619aebc879f0e81f5824 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { connect } from "react-redux"; | |
import { toggleSwitch } from "./UiReducer"; | |
const Toggle = ({ ui, toggleSwitch }) => ( | |
<div> | |
<div>{JSON.stringify(ui)}</div> | |
<input type="checkbox" value={ui.toggle} onChange={toggleSwitch} /> | |
</div> | |
); | |
const mapStateToProps = ({ ui }) => ({ | |
ui | |
}); | |
export default connect( | |
mapStateToProps, | |
{ toggleSwitch } | |
)(Toggle); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment