Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants