Reputation:
There is stepper of pages with steps 1 2 3. If a page reloads on the second or third step, it has to redirect to the first step.
How can I detect that page has been reloaded?
Upvotes: 0
Views: 592
Reputation: 5202
You can catch page load when componentDidMount
of your root component is fired :
class App extends React.Component {
constructor(props) {
super(props);
}
componentDidMount() {
// do something
}
}
Upvotes: 1