react-popper icon indicating copy to clipboard operation
react-popper copied to clipboard

usePopper has something wrong with ReactDom.flushSync

Open acgblogs opened this issue 3 years ago • 9 comments

image

how can i resolve the problem

acgblogs avatar May 16 '22 09:05 acgblogs

May you provide more details please?

FezVrasta avatar May 16 '22 10:05 FezVrasta

May you provide more details please?

i saw the open code react-popper hooks usePopper peerDependencies support react 16.8.0,

acgblogs avatar May 16 '22 10:05 acgblogs

"peerDependencies": { "@popperjs/core": "^2.0.0", "react": "^16.8.0 || ^17 || ^18", "react-dom": "^16.8.0 || ^17 || ^18" },

acgblogs avatar May 16 '22 10:05 acgblogs

but it didn't work on browser, my react-dom version is 16.8 same as react

acgblogs avatar May 16 '22 10:05 acgblogs

error is ReactDOM.flushSync is not a function

acgblogs avatar May 16 '22 10:05 acgblogs

image

acgblogs avatar May 16 '22 10:05 acgblogs

what is the value of console.log(ReactDOM)?

atomiks avatar May 16 '22 10:05 atomiks

what is the value of console.log(ReactDOM)?

image

the problem is resolved. use the version 2.2.5 can run successful.it seems that the ReactDOM. flushSync hooks acting on React version 18.x。

is the latest version 2.3.0 only suitable for React 18.x ?

acgblogs avatar May 16 '22 11:05 acgblogs

What you logged is React, not ReactDOM. There may be some problem with your setup.

FezVrasta avatar May 16 '22 11:05 FezVrasta