Last active
January 16, 2018 20:27
-
-
Save jacobp100/cf2407f06b8239ce40562333b87ddc09 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const App = connect(state => state, dispatch => ({ | |
setSearch: e => { | |
dispatch({ type: 'SET_SEARCH', search: e.target.value }) | |
} | |
}))(({ search, results, setSearch }) => ( | |
<div> | |
<input value={search} onChange={setSearch} /> | |
{results.map(result => ( | |
<div key={result}>{result}</div> | |
))} | |
</div> | |
)) | |
render( | |
<Provider store={store}> | |
<App /> | |
</Provider>, | |
document.getElementById('root') | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment