In NextJS Is it possible to have custom _app.js read a slug, getInitialProps and pass those props to every component including all pages?
I have looked around the docs to see if I can have _app.js read a slug (nothing mentioned about it). I need this slug to be added to an HTTP get request to grab the proper data that then then returns results to _app.js in which I can then use to pass props to all components and pages.
Example: when I go to http://localhost:3000/some-business-name , _app.js can grab the slug (some-business-name), do the request, and pass props to all components and pages in the project.
But what I am really struggling to do is get the App props to pass to all the rest of the pages inside the pages folder.
I am using a data file that is an array of business data objects to which I use to test dynamic routing with.
I have looked in the NextJS docs and I am having an issue understanding how this can be done. I still need for the slug to exist, I just need help understanding how I can get _app.js to completely take over dynamic routing.
Surprisingly I am able to receive App props on the LandingPage component in [slug].js but not in the success.js and error.js pages.
How do you write Jest tests for getInitialProps?
Vue.js Webpack Template in a Docker Container: How do I add Webpack-Dev-Server –watch-poll flag?