feat: add support for React@18 in backward compatible way (#9435)

Any React version matching this semver is supported: >= 16.8 < 19

Refs #8126
Refs #8414
This commit is contained in:
Vladimír Gorej
2023-12-20 16:50:22 +01:00
committed by GitHub
parent 08fe66b8fd
commit 98b53090cb
11 changed files with 2153 additions and 24278 deletions

View File

@@ -1,6 +1,6 @@
const { JSDOM } = require("jsdom")
const Enzyme = require("enzyme")
const Adapter = require("@wojtekmaj/enzyme-adapter-react-17")
const { default: Adapter } = require("@cfaester/enzyme-adapter-react-18")
const win = require("../../src/core/window")

View File

@@ -1,6 +1,6 @@
import { JSDOM } from "jsdom"
import Enzyme from "enzyme"
import Adapter from "@wojtekmaj/enzyme-adapter-react-17"
const { default: Adapter } = require("@cfaester/enzyme-adapter-react-18")
import win from "../../src/core/window"
@@ -29,7 +29,7 @@ function setUpDomEnvironment() {
}
copyProps(win, window) // use UI's built-in window wrapper
copyProps(window, global)
// https://github.com/jsdom/jsdom/issues/1721
if (typeof global.window.URL.createObjectURL === "undefined") {
Object.defineProperty(global.window.URL, "createObjectURL", { value: () => "data:text/plain;base64,SGVsbG8sIFdvcmxkIQ==" })