Commit graph

11 commits

Author SHA1 Message Date
Clive Townsend
3421b482c2
Typo (#45380)
## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [X ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-01-28 21:41:06 +00:00
Zeki Can Ekşi
47c1019666
typo (#42968)
just a small typo
2022-11-15 22:16:30 +00:00
Lee Robinson
a05a0c7784
Update the documentation. (#41758)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Matt Kane <m@mk.gg>
Co-authored-by: Ismael <ismael.rumzan@gmail.com>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-10-26 14:04:45 -07:00
Dave Welsh
8bc93d0209
Typescript Documentation Improvement for Persistent Layouts (#33659)
By making `NextPageWithLayout` generic and passing the type parameters to `NextPage`, our pages can continue to specify the props explicitly. This gives us type safety in `getInitialProps`, for example.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-08-22 09:42:24 +00:00
Lee Robinson
741626559d
Improve next/dynamic docs and add links to layouts RFC. (#37244)
- Updates `next/dynamic` docs to teach Suspense first
- Adds links to Layouts RFC in layouts/pages docs
- Clarifies and simplifies streaming docs

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-05-29 23:48:41 +00:00
jpveilleux
0234e6d553
Added type to Page Component for TypeScript (#36608)
* Added type to Page Component for TypeScript

Following this tutorial, I noticed that TS was complaining that "getLayout" did not exist on Page. That is normal since Page is typed as NextPage. I simply exported the new type we create in "_App.tsx" and used it as the return type for Page. This will probably help others seeing that red in their editors and perhaps being confused.

* Small linting change

* Apply suggestions from code review

* Update layouts.md

* lint fix

* update type

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-05-03 15:58:31 -05:00
Hassan El Mghari
ca8530ffc8
Changed all occurrences of etc to match (#34280)
The [correct](https://www.grammarly.com/blog/et-cetera-etc/) way to use et cetera is to put a period right after and a comma behind it if it's being used as a list. I updated the occurrences in the docs and examples that didn't match these rules.
2022-02-13 00:22:52 +00:00
Sjors Smits
34d418c12d
[docs] Added per page layout example with TypeScript (#27488)
## Documentation / Examples

- [x] Make sure the linting passes

## Explanation
Fixes #27465 

I added some docs on how to use per page persistent layouts in TypeScript as this requires you to extend some types and it might not be trivial if you are just starting out with TypeScript.

I copied the js example so it might be better to remove some of the duplication where possible, let me know.
All feedback is welcome
2021-07-30 16:30:32 +00:00
Sam Robbins
187f4312cc
Use named functions in layouts docs (#27297)
## Documentation / Examples
- [x] Make sure the linting passes

Fixes #27252 by using a named function rather than an arrow function. If this is the correct fix, then modifications are also needed for the `layout-component` example, but I'm just providing this one modification right now in case this fix is incorrect.
2021-07-19 19:15:53 +00:00
Lee Robinson
a93f8b6393
Fix code block in Layouts docs. (#27130)
<img width="885" alt="CleanShot 2021-07-12 at 17 58 23@2x" src="https://user-images.githubusercontent.com/9113740/125365933-c2c17a00-e33a-11eb-9d24-5970b5437a21.png">
2021-07-12 23:04:06 +00:00
Lee Robinson
26f4794944
[docs] Layouts & Going to Production (#27021)
- Helps clear up customer confusion about how to share React state with layouts, including nested layouts
- Provides guidance on best practices before shipping your application to production

Open to any feedback!
2021-07-12 19:04:43 +00:00