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

flushSync not in compat #2636

Closed
tomByrer opened this issue Jul 18, 2020 · 2 comments
Closed

flushSync not in compat #2636

tomByrer opened this issue Jul 18, 2020 · 2 comments
Labels

Comments

@tomByrer
Copy link

When trying to use Adobe's React-Spectrum I get this error:
ERROR in ./node_modules/@react-aria/virtualizer/dist/module.js 154:4-13 "export 'flushSync' was not found in 'react-dom'

It is used only in one place.

React has two different versions listed in their codebase. Only docs I could find is this comment:

You also have an option to flush the entire tree if you know what you’re doing. The API is called ReactDOM.flushSync(fn). Note that it actually forces complete re-rendering for updates that happen inside of the call, so you should use it very sparingly. This way it doesn’t break the guarantee of internal consistency between props, state, and refs.

I'm wondering if a noop would be OK for now rather than having to implant the flushing?

@marvinhagemeister
Copy link
Member

A no-op or stubbing it out via useEffect is worth a try. If we're lucky that could be all that's needed. In our case we'll have already flushed the tree to the DOM by then, so it should work.

@JoviDeCroock
Copy link
Member

Added in #3094

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

No branches or pull requests

3 participants