Skip to content

Commit

Permalink
fix(formily-antd): fix form-grid stuck with repeat key
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanxiaoyu authored Jan 18, 2022
1 parent 6851c71 commit 1f9a758
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions formily/antd/src/components/FormGrid/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import React, { useState } from 'react'
import { FormGrid as FormilyGird } from '@formily/antd'
import { TreeNode, createBehavior, createResource } from '@designable/core'
import {
Expand Down Expand Up @@ -26,9 +26,12 @@ export const FormGrid: DnFC<React.ComponentProps<formilyGrid>> & {
(buf, child) => buf + (child.props?.['x-component-props']?.gridSpan ?? 1),
0
)

const key = new Date().getTime()

return (
<div {...nodeId} className="dn-grid">
<FormilyGird {...props} key={totalColumns}>
<FormilyGird {...props} key={key}>
{props.children}
</FormilyGird>
<LoadTemplate
Expand Down

0 comments on commit 1f9a758

Please sign in to comment.