react router dom go to page with refresh code example

Example 1: react router refresh page

location.reload();

Example 2: react router browser refresh

// Add the following to .htaccess file in the public folder
// NOTE: This is for Apache servers!

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.html$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-l
  RewriteRule . /index.html [L]
</IfModule>