rsnext/packages/next/client/components
Jiachi Liu 60dd6dfc9b
Fix module error for findDOMNode on edge (#43998)
## Bug

The `findDOMNode` will be exported from ReactDOM in esm mode, but it's
not defined for SSR since SSR is using react-dom server stub bundle
which doesn't contain any thing. So `import { findDOMNode } from
'react-dom'` will error in that case with bundling.

Since it's only being used on client, we import ReactDOM and call
`ReactDOM.findDOMNode` to avoid bundling error and adding a condition to
tree-shake it off on client

[slack
thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1670608621289259)

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)
2022-12-13 09:16:01 -08:00
..
react-dev-overlay Fast refresh should recover from event handler errors in app dir (#43882) 2022-12-13 04:48:18 +00:00
app-router-headers.ts Update cache handling for app (#43659) 2022-12-02 23:32:49 -08:00
app-router.tsx Fix typo in comment (#43685) 2022-12-04 13:34:15 -08:00
bailout-to-client-rendering.ts useSearchParams - bailout to client rendering during static generation (#43603) 2022-12-12 11:53:38 +00:00
error-boundary.tsx Display error digest if presented (#43742) 2022-12-07 17:34:25 +01:00
error.tsx Add default not found template (#41750) 2022-10-24 15:46:59 -07:00
head.tsx Add default head for app dir (#43963) 2022-12-12 19:10:42 -08:00
headers.ts fix: Dynamic Usage Error when using previewData with generateStaticParams and appDir (#43395) 2022-11-30 20:28:05 -08:00
hooks-server-context.ts Upgrade react@experimental (#40885) 2022-09-25 21:35:05 +02:00
infinite-promise.ts Handle redirects in new router (#40396) 2022-09-20 15:28:07 +02:00
layout-router.tsx Fix module error for findDOMNode on edge (#43998) 2022-12-13 09:16:01 -08:00
match-segments.ts Flush styles effects (#39268) 2022-08-03 16:21:20 +00:00
navigation.ts useSearchParams - bailout to client rendering during static generation (#43603) 2022-12-12 11:53:38 +00:00
noop-head.tsx Alias next/head to noop for rsc and add upgration warning (#43885) 2022-12-09 14:45:31 +00:00
not-found.ts Add never return type for redirect() and notFound() (#42009) 2022-10-27 15:07:59 -07:00
redirect.ts Add never return type for redirect() and notFound() (#42009) 2022-10-27 15:07:59 -07:00
reducer.ts Remove resolved app directory todos (#43672) 2022-12-03 20:34:53 +00:00
render-from-template-context.tsx Client component directive: use client (#41333) 2022-10-11 10:26:45 -07:00
request-async-storage.ts Replace global with globalThis (#42627) 2022-11-08 14:45:30 +01:00
static-generation-async-storage.ts Update cache handling for app (#43659) 2022-12-02 23:32:49 -08:00
static-generation-bailout.ts useSearchParams - bailout to client rendering during static generation (#43603) 2022-12-12 11:53:38 +00:00
use-reducer-with-devtools.ts misc: make useReducerWithDevtools noop on server (#41019) 2022-09-29 10:08:44 +00:00