已动态创建id为""的组件styled.div

The component styled.div with the id of "" has been created dynamically

我正在使用带有服务器端分页过滤和排序的 react-data-table 组件,一切正常,但我收到这些警告,我无法理解如何解决,我看了看对于一个解决方案,但我只找到了关于在函数外声明样式组件的答案,但问题是不是我使用了样式组件,而是 react-data-table 正在使用它。 这是我收到的警告:

Keyframes.js:20 The component styled.div with the id of "sc-bdnxRM" has been created dynamically. You may see this warning because you've called styled inside another component. To resolve this only create new StyledComponents outside of any render method and function component. Pe @ 
Keyframes.js:20 Keyframes.js:20 The component styled.div with the id of "sc-gtsrHT" has been created dynamically. You may see this warning because you've called styled inside another component. To resolve this only create new StyledComponents outside of any render method and function component. Pe 
@ Keyframes.js:20 Keyframes.js:20 The component styled.div with the id of "sc-dlnjwi" has been created dynamically. You may see this warning because you've called styled inside another component. To resolve this only create new StyledComponents outside of any render method and function component. Pe 
@ Keyframes.js:20 Keyframes.js:20 The component styled.div with the id of "sc-hKFxyN" has been created dynamically. You may see this warning because you've called styled inside another component. To resolve this only create new StyledComponents outside of any render method and function component. Pe @ Keyframes.js:20 Keyframes.js:20 The component Styled(styled.div) with the id of "sc-eCApnc" has been created dynamically. You may see this warning because you've called styled inside another component. To resolve this only create new StyledComponents outside of any render method and function component.

我是react和react-data-table.

新手

我通过添加 import "react-data-table-component" 解决了我的问题;在 App.js 中,在此之前我只在我创建的组件中从“react-data-table-component”调用了 datatable ,看来我必须将其导入 app.js 还有