rsnext/test
Hannes Bornö 8b99e06e30
Improve errors caused by Next.js client hook called in a server component (#44588)
Throws if any of the Next.js client hooks are used in a server component in DEV.

```
Error: useSearchParams only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more: https://nextjs.org/docs/messages/react-client-hook-in-server-component
```

Fixes NEXT-287

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/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`
- [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-01-06 02:21:56 +00:00
..
.stats-app Remove serverComponents from next.conf.js because it's unused (#43805) 2022-12-07 15:57:03 +01:00
__mocks__ Update Edge Runtime (#38862) 2022-07-21 18:29:19 +00:00
development Improve errors caused by Next.js client hook called in a server component (#44588) 2023-01-06 02:21:56 +00:00
e2e Update subset validation in @next/font/google and fix CJK bug (#44594) 2023-01-05 15:51:38 -08:00
integration Update CNA test skipping (#44606) 2023-01-05 11:25:47 -08:00
lib Change NextInstance.fetch Signature (#44575) 2023-01-05 16:31:03 +01:00
production Update subset validation in @next/font/google and fix CJK bug (#44594) 2023-01-05 15:51:38 -08:00
unit Update subset validation in @next/font/google and fix CJK bug (#44594) 2023-01-05 15:51:38 -08:00
.gitignore Fix server html insertion target (#42591) 2022-11-07 18:16:13 +01:00
jest-setup-after-env.ts Adds tests to ensure eslint-plugin-next's available rules are properly exported and recommended rules are correctly defined. (#38183) 2022-06-30 11:31:33 -05:00
jest.d.ts Adds tests to ensure eslint-plugin-next's available rules are properly exported and recommended rules are correctly defined. (#38183) 2022-06-30 11:31:33 -05:00
readme.md refactor: split up CONTRIBUTING.md (#40515) 2022-09-16 14:54:58 -07:00
test-file.txt

See Testing for more information on how you can run/write/debug tests for Next.js.