Last active
January 21, 2020 14:35
-
-
Save baso53/7c7e6f918df603988df4ce31e5baecd5 to your computer and use it in GitHub Desktop.
implementing-sagas-App-1
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
| import React from 'react'; | |
| import { connect } from 'react-redux'; | |
| import { fetchDataRequest } from './actions'; | |
| import "./App.css"; | |
| const App = props => ( | |
| <React.Fragment> | |
| <div className='button' onClick={() => props.fetchDataRequest('male')} > | |
| Fetch a random male name! | |
| </div> | |
| <div className='button' onClick={() => props.fetchDataRequest('female')} > | |
| Fetch a random male name! | |
| </div> | |
| <div> | |
| Hey, I'm {props.personState.name} {props.personState.surname} from {props.personState.region} | |
| </div> | |
| </React.Fragment> | |
| ); | |
| const mapStateToProps = ({ personState }) => ({ personState }); | |
| export default connect(mapStateToProps, { fetchDataRequest })(App); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment