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

🐛[BUG]protable 启用search会警告 #8382

Closed
lengsukq opened this issue May 6, 2024 · 1 comment
Closed

🐛[BUG]protable 启用search会警告 #8382

lengsukq opened this issue May 6, 2024 · 1 comment

Comments

@lengsukq
Copy link

lengsukq commented May 6, 2024

🐛 bug 描述

protable 启用search会警告

Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of DomWrapper which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node

💻 复现代码

<>
            <EditableProTable<DataSourceType>
                rowKey="token_id"
                headerTitle="Token管理"
                maxLength={11}
                scroll={{
                    x: 960,
                }}
                recordCreatorProps={
                    {
                        position: position as 'top',
                        record: () => ({ token_id: (Math.random() * 1000000).toFixed(0) }),
                    }
                }
                loading={false}
                search={{}}
                toolBarRender={() => [
                    <ProFormRadio.Group
                        key="render"
                        fieldProps={{
                            value: position,
                            onChange: (e) => setPosition(e.target.value),
                        }}
                        options={[
                            {
                                label: '添加到顶部',
                                value: 'top',
                            },
                            {
                                label: '添加到底部',
                                value: 'bottom',
                            },
                            {
                                label: '隐藏',
                                value: 'hidden',
                            },
                        ]}
                    />,
                ]}
                columns={columns}
                pagination={{ pageSize:pageSize,current:current,showSizeChanger:true}}
                params={{}}
                request={...一些逻辑}
                actionRef={actionRef}
                value={dataSource}
                onChange={setDataSource}
                editable={...一些逻辑}
            />
            <ProCard title="表格数据" headerBordered collapsible defaultCollapsed>
                <ProFormField
                    ignoreFormItem
                    fieldProps={{
                        style: {
                            width: '100%',
                        },
                    }}
                    mode="read"
                    valueType="jsonCode"
                    text={JSON.stringify(dataSource)}
                />
            </ProCard>
        </>

🏞 期望结果

不希望出现警告

© 版本信息

  • ProComponents 版本: [2.7.1]
    -nextjs版本:[14.1.4]
  • 浏览器环境[edge浏览器]
  • 开发环境 [win11]

🚑 其他信息

image

@fnoopv
Copy link
Contributor

fnoopv commented May 7, 2024

ref react-component/util#98

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

No branches or pull requests

3 participants