-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add shim for react-dom/client for React 17
- Loading branch information
1 parent
e86d014
commit 60fd22a
Showing
2 changed files
with
16 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Shim for React 17 react-dom/client entrypoint imported by React Testing | ||
// Library | ||
|
||
module.exports = { | ||
hydrateRoot: () => { | ||
throw new Error( | ||
"Cannot use hydrateRoot with React 17. Ensure this uses legacy root instead" | ||
); | ||
}, | ||
createRoot: () => { | ||
throw new Error( | ||
"Cannot use createRoot with React 17. Ensure this uses legacy root instead" | ||
); | ||
}, | ||
}; |