Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

reload page in react router dom v6

import React from 'react';
import { useHistory, useLocation } from 'react-router-dom';

const Component = () => {
  const history = useHistory();
  const location = useLocation();

  const reload = () => {
    history.push(location.pathname);
  };

  return (
    ...
  );
};
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #reload #page #react #router #dom
ADD COMMENT
Topic
Name
7+4 =