mantinedev / mantine

A fully featured React components library
https://mantine.dev
MIT License
26.79k stars 1.9k forks source link

Warning: flushSync was called from inside a lifecycle method. #1823

Closed sunknudsen closed 2 years ago

sunknudsen commented 2 years ago

What package has an issue

@mantine/core

Describe the bug

When using Popover with positionDependencies set to props.value, following warning is thrown.

Warning: flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task. Popper@https://jsh4rc.csb.app/node_modules/@mantine/core/esm/components/Popper/Popper.js:67:16 div $csb$eval/Box<@https://jsh4rc.csb.app/node_modules/@mantine/core/esm/components/Box/Box.js:43:85 Popover@https://jsh4rc.csb.app/node_modules/@mantine/core/esm/components/Popover/Popover.js:69:63 PopoverTextarea@https://jsh4rc.csb.app/src/App.tsx:35:25 Form@https://jsh4rc.csb.app/src/App.tsx:83:34 MantineProvider@https://jsh4rc.csb.app/node_modules/@mantine/styles/esm/theme/MantineProvider.js:99:25 App

In which browser did the problem occur

Electron

If possible, please include a link to a codesandbox with the reproduced problem

https://codesandbox.io/s/stoic-lichterman-jsh4rc

Do you know how to fix the issue

No

Are you willing to participate in fixing this issue and create a pull request with the fix

No

Possible fix

No response

sunknudsen commented 2 years ago

Btw, Mantine is such a blessing with an amazing developer experience. Thanks to everyone who made this possible. 🙌

rtivital commented 2 years ago

You can ignore this warning, react-popper will be removed in 5.0

rtivital commented 2 years ago

Fixed in 5.0