reduction-admin / react-reduction

React Reduction - Free Admin Template Built with React and Bootstrap4
https://reduction-admin.github.io/react-reduction/
MIT License
1.51k stars 562 forks source link

unable to push to history on Logout button in Header.js #49

Open anupamz1 opened 4 years ago

anupamz1 commented 4 years ago

I am unable to get history object and modify Logout feature , i had used below method on Button click: image

adshin21 commented 4 years ago

In the Header.js file router is not present so that the history object will also be not present. A very simple solution is to import react-router-dom and then use withRouter HOC at the time of export.

import {withRouter} from 'react-router-dom;

export default withRouter(Header);

adshin21 commented 4 years ago

@anupamz1 please ping me if it works or not