Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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)
- Loading branch information
Showing
4 changed files
with
22 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters