Skip to content

Instantly share code, notes, and snippets.

@YKalashnikov
Created July 4, 2019 00:59
Show Gist options
  • Save YKalashnikov/801bd3db62487d2f1af9d0c841b916ca to your computer and use it in GitHub Desktop.
Save YKalashnikov/801bd3db62487d2f1af9d0c841b916ca to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
import { Switch, Route } from 'react-router-dom';
import {connect} from 'react-redux';
import {getProfileFetch} from './redux/actions';
import Signup from './components/Signup';
import Login from './components/Login';
class App extends Component {
componentDidMount = () => {
this.props.getProfileFetch()
}
render() {
return (
<div>
<Switch>
<Route path="/signup" component={Signup}/>
<Route path="/login" component={Login}/>
</Switch>
</div>
);
}
}
const mapDispatchToProps = dispatch => ({
getProfileFetch: () => dispatch(getProfileFetch())
})
export default connect(null, mapDispatchToProps)(App);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment