Skip to content

Commit

Permalink
Merge pull request #187 from flareact/canary
Browse files Browse the repository at this point in the history
- Fixes issue causing browser back button to not work if user landed on a [slug] page.
- Fixes issue causing webpack js file to not be versioned on build.
  • Loading branch information
tj-kev committed Oct 20, 2021
2 parents 202ccd0 + 9c60d86 commit 3735324
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions configs/webpack.client.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ module.exports = (env, argv) => {
},
output: {
path: path.resolve(projectDir, "out/_flareact/static"),
filename: `${dev ? "[name]" : "[name].[contenthash]"}.js`,
chunkFilename: `${dev ? "[name]" : "[name].[contenthash]"}.js`,
},
plugins: [
Expand Down
5 changes: 5 additions & 0 deletions src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ export function RouterProvider({
};
}, [protocol, host, route.asPath, params]);

useEffect(() => {
// On initial page load, replace history state with format expected by router
window.history.replaceState(route, null, route.asPath);
}, [])

useEffect(() => {
async function loadNewPage() {
const { href, asPath } = route;
Expand Down

0 comments on commit 3735324

Please sign in to comment.