Skip to content

Instantly share code, notes, and snippets.

@dantenovski
Created November 10, 2017 01:36
Show Gist options
  • Save dantenovski/2dd053c346ab91e94de24139d9bde392 to your computer and use it in GitHub Desktop.
Save dantenovski/2dd053c346ab91e94de24139d9bde392 to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
import { Link, withRouter } from 'react-router-dom';
import '../../build/assets/css/style.css';
const HandleLogin = withRouter(({ history }) => (
<button onClick={() => {
history.push('/')
}}>Sign out</button>
))
class RegisterLogin extends Component {
constructor(props){
super(props);
....
....
render(){
...
<div className="submit-responses">
{ this.props.submitResponses.login == 'post success' ?
(withRouter(({ history }) => ( history.push('/'))))() :
'' }
</div>
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment