Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

usePopper has something wrong with ReactDom.flushSync #445

Open
acgblogs opened this issue May 16, 2022 · 9 comments
Open

usePopper has something wrong with ReactDom.flushSync #445

acgblogs opened this issue May 16, 2022 · 9 comments

Comments

@acgblogs
Copy link

image

how can i resolve the problem

@FezVrasta
Copy link
Member

May you provide more details please?

@acgblogs
Copy link
Author

May you provide more details please?

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

@acgblogs
Copy link
Author

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

@acgblogs
Copy link
Author

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

@acgblogs
Copy link
Author

error is ReactDOM.flushSync is not a function

@acgblogs
Copy link
Author

image

@atomiks
Copy link
Collaborator

atomiks commented May 16, 2022

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

@acgblogs
Copy link
Author

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 ?

@FezVrasta
Copy link
Member

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants