-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove: adding [...] dynamic page routes makes onCreatePage not needed
- Loading branch information
1 parent
9dab71f
commit 1cad5f5
Showing
1 changed file
with
0 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +0,0 @@ | ||
// Tutorial from: https://www.gatsbyjs.com/tutorial/authentication-tutorial/#creating-client-only-routes | ||
// Implement the Gatsby API “onCreatePage”. This is | ||
// called after every page is created. | ||
exports.onCreatePage = async ({ page, actions }) => { | ||
const { createPage } = actions; | ||
|
||
// page.matchPath is a special key that's used for matching pages | ||
// only on the client. | ||
if (page.path.match(/^\/profile/)) { | ||
page.matchPath = '/profile/*'; | ||
|
||
// Update the page. | ||
createPage(page); | ||
} | ||
}; | ||