-
Notifications
You must be signed in to change notification settings - Fork 994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gh11385] Updated the generated page template #11533
Conversation
@Josh-Walker-GM I could use your help with the tests (please) -- I updated the fixtures, but it looked like there was also a snapshot file that will need to be updated. |
packages/cli/src/commands/generate/page/templates/page.tsx.template
Outdated
Show resolved
Hide resolved
packages/cli/src/commands/generate/page/__tests__/__snapshots__/page.test.js.snap
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahaywood awesome. I tweaked a little as we discussed. If you want to sanity check and then merge it looks good to me!
Fixes #11385 ## Feature description When you create a brand new page, the template includes a `<Link />` to that page. ``` <p> My default route is named <code>upgradeGuide</code>, link to me with ` <Link to={routes.upgradeGuide()}>UpgradeGuide</Link>` </p> ``` If you already created a parameter with the routes.tsx file <Route path="/upgrade/{slug:string}" page={UpgradeGuideIndividualPage} name="upgradeGuideIndividual" /> Then, the first time you load the page in the browser, you'll get an error because you didn't specify a parameter within the Link Every once in a while this still throws me off. ## Analysis and Design I considered using a `<pre>` tag or a `<code>` tag, but it would still throw the same error. ## Solution description I updated all the templates to include the path within a comment. --------- Co-authored-by: Josh GM Walker <56300765+Josh-Walker-GM@users.noreply.github.com>
Fixes #11385
Feature description
When you create a brand new page, the template includes a
<Link />
to that page.If you already created a parameter with the routes.tsx file
Then, the first time you load the page in the browser, you'll get an error because you didn't specify a parameter within the Link Every once in a while this still throws me off.
Analysis and Design
I considered using a
<pre>
tag or a<code>
tag, but it would still throw the same error.Solution description
I updated all the templates to include the path within a comment.