Commit 8c3a76e
Updated docs for getServerSideProps and getStaticProps return values (vercel#33577)
This fixes the documentation for getServerSideProps and getStaticProps which mislead the defined type.
Current screenshot taken from [nextjs doc](https://nextjs.org/docs/api-reference/data-fetching/get-server-side-props)

However, the declared type for these types are using union type which represents **any of the following** instead of **optional**.
Declared types;
[GetStaticPropsResult](https://github.com/vercel/next.js/blob/canary/packages/next/types/index.d.ts#L107)

[GetServerSidePropsResult](https://github.com/vercel/next.js/blob/canary/packages/next/types/index.d.ts#L160)

---
### This PR updates the documentation for their return values;
**Before**: The `...` function should return an object with the following **optional** properties:
**After**: The `...` function should return object with **any one of the following** properties:
---
## Bug
- [x] 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
- [x] 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`
Co-authored-by: Vadi Taslim <70912283+vaditaslim@users.noreply.github.com>1 parent 175968c commit 8c3a76e
File tree
2 files changed
+2
-2
lines changed- docs/api-reference/data-fetching
2 files changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
0 commit comments