formilyjs / antd

Formily Ant Design Adaptor
MIT License
55 stars 47 forks source link

fix(array-table): body wrapper was recreated in every table re-render #44

Closed hmilin closed 3 months ago

hmilin commented 3 months ago

Before submitting a pull request, please make sure the following is done...

Please do not delete the above content


What have you changed?

当前Table组件的components.body.wrapper参数在每次重新渲染时都返回新的函数组件,导致每次arrayField变化(如push一条数据)时,tbody以下的组件都重新创建并挂载而非update

修改前

<Table
    components={{
      body: {
        wrapper: genWrapperComp(dataSource, startIndex),
        row: RowComp,
      },
    }}
  />

修改后

<Table
    components={{
      body: {
        wrapper: WrapperComp,
        row: RowComp,
      },
    }}
  />
netlify[bot] commented 3 months ago

Deploy Preview for formily-antd5 ready!

Name Link
Latest commit bb80d3f8fc3092b6f84f54ff00a81e9ae45bcce7
Latest deploy log https://app.netlify.com/sites/formily-antd5/deploys/66a84d8631a20b0008454224
Deploy Preview https://deploy-preview-44--formily-antd5.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.