From cb415f8a641e6b4bb91691a3feb721225dd37111 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Sat, 9 Apr 2022 01:59:08 +0800 Subject: [PATCH] test: Fix react 18 error. --- test/react-hotkeys.test.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/react-hotkeys.test.tsx b/test/react-hotkeys.test.tsx index 581ded69..71c5bb78 100644 --- a/test/react-hotkeys.test.tsx +++ b/test/react-hotkeys.test.tsx @@ -1,6 +1,7 @@ /* eslint-disable jest/no-conditional-expect */ import React from 'react' -import ReactDOM from 'react-dom' +// import ReactDOM from 'react-dom' +import { createRoot } from 'react-dom/client'; import TestRenderer from 'react-test-renderer'; import Hotkeys from '../src'; @@ -117,8 +118,8 @@ describe(' Event 222.', () => { return element } const elm = setup() - - ReactDOM.render( + const root = createRoot(elm); + root.render( { @@ -140,7 +141,6 @@ describe(' Event 222.', () => { >
- ,elm ); });