semantic-ui-react <Responsive> 不适用于 <Table.Cell>
semantic-ui-react <Responsive> not working for <Table.Cell>
我正在使用语义-ui 反应来呈现 table 数据。我的要求ui评论是,当页面在移动视图上时,我隐藏了某些列。我尝试在 Table.Cell
元素上使用 className="mobile hidden"
但这似乎根本不起作用。
然后我尝试使用如下所示的 Responsive
组件,但出现错误。我在这里错过了什么吗?无法找到其他人遇到此问题...
<Responsive as={Table.Cell} minWidth={Responsive.onlyMobile.minWidth}>
{record.datapoint}
</Responsive>
我在调整 window...
大小时在控制台中收到此错误
index.js:2177 Warning: Can only update a mounted or mounting component. This usually means you called setState, replaceState, or forceUpdate on an unmounted component. This is a no-op.
Please check the code for the Responsive component.
事实上,这是一个错误 :( 我已经创建了 PR 来解决所描述的问题,请参阅 Semantic-Org/Semantic-UI-React#2421。
您提供的代码没有重现问题,提供的示例永远不会出现该问题。但是,它存在 :) 核心问题是 Responsive
组件的卸载,当它将由父级完成时,setState()
将在未安装的组件上调用。 codesandbox 上的一个示例重现了问题。
我正在使用语义-ui 反应来呈现 table 数据。我的要求ui评论是,当页面在移动视图上时,我隐藏了某些列。我尝试在 Table.Cell
元素上使用 className="mobile hidden"
但这似乎根本不起作用。
然后我尝试使用如下所示的 Responsive
组件,但出现错误。我在这里错过了什么吗?无法找到其他人遇到此问题...
<Responsive as={Table.Cell} minWidth={Responsive.onlyMobile.minWidth}>
{record.datapoint}
</Responsive>
我在调整 window...
大小时在控制台中收到此错误index.js:2177 Warning: Can only update a mounted or mounting component. This usually means you called setState, replaceState, or forceUpdate on an unmounted component. This is a no-op.
Please check the code for the Responsive component.
事实上,这是一个错误 :( 我已经创建了 PR 来解决所描述的问题,请参阅 Semantic-Org/Semantic-UI-React#2421。
您提供的代码没有重现问题,提供的示例永远不会出现该问题。但是,它存在 :) 核心问题是 Responsive
组件的卸载,当它将由父级完成时,setState()
将在未安装的组件上调用。 codesandbox 上的一个示例重现了问题。