Route as a modal not working when using getStaticProps
See original GitHub issueBug report
Describe the bug
https://github.com/zeit/next.js/tree/canary/examples/with-route-as-modal does not work when using getStaticProps.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Clone the example and add an empty getStaticProps.
Expected behavior
I don’t know if this a bug or expected behavior. Why shouldn’t you able to use shallow routing with dynamic routes?
System information
- OS: macOS
- Browser: Chrome
- Version of Next.js: 9.3.5
- Version of Node.js: 13.11.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Route as a modal not working when using getStaticProps
Expected behavior. I don't know if this a bug or expected behavior. Why shouldn't you able to use shallow routing with dynamic routes?...
Read more >NextJs: Is it possible to load a static page (with dynamic routes ...
Goal: Open statically generated pages inside of a modal on the home page. ... generated articles using getStaticProps/getStaticPaths.
Read more >Shallow Routing - Next.js
Shallow routing allows you to change the URL without running data fetching methods again, that includes getServerSideProps , getStaticProps , and ...
Read more >Pre-Rendering and Data Fetching Strategies in Next.js - Telerik
However, the page won't be interactive (like opening a modal) until ... to use both getStaticPaths and getStaticProps , but if it isn't...
Read more >How to use Prisma in a Next.js app - Daily.dev
See that we are using the Prisma from Node.js; the API routes, ... please report it in https://github.com/prisma/prisma/issues.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@IAmMorrow & @nimabrownlee – In case it helps to see, here is an approach I’ve used, I have a PR up for a dynamic routes (w/
getStaticProps) variant of this example https://github.com/zeit/next.js/pull/12945I do not know the reason behind this limitation, but it seems that you can’t use this trick if the
hrefis a dynamic route. This is a big drawback. Perhaps this is something that can be easily fixed by the next team.