简体   繁体   English

警告:从生命周期方法内部调用了 flushSync

[英]Warning: flushSync was called from inside a lifecycle method

Would anyone know how to debug and fix (or mute) following warning (apparently, Mantine is dropping react-popper in next major release)?有人知道如何在警告后调试和修复(或静音)吗(显然, Mantine在下一个主要版本中放弃了react-popper )?

Everything works fine, but warning is making it very hard to debug other issues.一切正常,但警告使调试其他问题变得非常困难。

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.
    at Popper (webpack-internal:///./node_modules/@mantine/core/esm/components/Popper/Popper.js:67:3)
    at div
    at eval (webpack-internal:///./node_modules/@mantine/core/esm/components/Box/Box.js:42:18)
    at Popover (webpack-internal:///./node_modules/@mantine/core/esm/components/Popover/Popover.js:76:85)
    at O (webpack-internal:///./node_modules/styled-components/dist/styled-components.browser.esm.js:30:19811)
    at SecretTextareaWithLength (webpack-internal:///./src/main/routes/Create.tsx:106:48)
    at form
    at div
    at O (webpack-internal:///./node_modules/styled-components/dist/styled-components.browser.esm.js:30:19811)
    at Create (webpack-internal:///./src/main/routes/Create.tsx:291:48)
    at Routes (webpack-internal:///./node_modules/react-router/index.js:920:5)
    at MenuEvents (webpack-internal:///./src/main/MenuEvents.tsx:34:55)
    at Router (webpack-internal:///./node_modules/react-router/index.js:854:15)
    at MemoryRouter (webpack-internal:///./node_modules/react-router/index.js:767:5)
    at MantineProvider (webpack-internal:///./node_modules/@mantine/styles/esm/theme/MantineProvider.js:66:3)
    at App (webpack-internal:///./src/main/App.tsx:40:35)

this is a bug in mantine When using Popper.这是使用 Popper 时 mantine 中的一个错误 it will be fixed in the next release.它将在下一个版本中修复。

one thing you can do is hack your local react copy to add conditional logic and skip this warning.您可以做的一件事是破解您的本地反应副本以添加条件逻辑并跳过此警告。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 react-bootstrap-typeahead 错误:从生命周期方法内部调用了 flushSync - react-bootstrap-typeahead error: flushSync was called from inside a lifecycle method 函数组件内的 ReactJS 生命周期方法 - ReactJS lifecycle method inside a function Component 在 useEffect 中使用 flushSync() 是否和使用 useLayoutEffect 一样? - With flushSync() inside useEffect do we do the same as using useLayoutEffect? react-transition-group生命周期方法componentWillLeave不被调用 - react-transition-group lifecycle method componentWillLeave not being called 添加回调到从arr map方法内部调用的函数 - Add callback to function that is called from inside arr map method 从 componentDidUpdate 生命周期方法重写 useEffect 钩子 - Rewrite useEffect hook from componentDidUpdate lifecycle method 我想测试是否在生命周期方法 componentDidMount 中调用了某个方法,但出现错误 - I want to test whether a method is called within the lifecycle method componentDidMount, but I am getting an error 如何禁用 React Hook “useCallback”不能在回调警告中调用? - How to disable React Hook “useCallback” cannot be called inside a callback warning? 警告:无法在类型'OnLifecycleEvent'中找到注释方法'value()':找不到android.arch.lifecycle.OnLifecycleEvent的类文件 - warning: Cannot find annotation method 'value()' in type 'OnLifecycleEvent': class file for android.arch.lifecycle.OnLifecycleEvent not found react-native-router-flux:没有React生命周期方法在后台导航时被调用 - react-native-router-flux : No React lifecycle method is getting called on back navigation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM