Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Add getInitialProps example #3

Open
amclin opened this issue Oct 8, 2019 · 2 comments
Open

Add getInitialProps example #3

amclin opened this issue Oct 8, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@amclin
Copy link
Owner

amclin commented Oct 8, 2019

Add a simple getInitialProps example to the home page

getInitialProps is the recommended way to get page-level context in NextJS for things like URL parameters:

@KevinDanikowski
Copy link

THere is an example note that has been merged in inside _document.js. This can be closed

@amclin
Copy link
Owner Author

amclin commented Jan 15, 2020

This could be combined with #72 to show how a query string &lang=en or a session string can be used to populate the HTML lang attribute. (Note a direct passthrough of the value would be a significant security risk. It would need to be validated against a list of safe values).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants