Skip to content

Commit

Permalink
chore(release): optimize performance
Browse files Browse the repository at this point in the history
  • Loading branch information
97vack authored Mar 14, 2024
1 parent d30d3f0 commit 7d636c1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/demos/_dymic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useForm } from 'react-form-simple';
import { getUuid } from 'react-form-simple/utils/util';

export default function App() {
const { model, render, validate } = useForm({
const { model, render, validate, forceUpdate } = useForm({
fieldsDymic: [{ value: 0, uid: getUuid() }],
});
const { fieldsDymic } = model;
Expand All @@ -21,6 +21,7 @@ export default function App() {
style={{ height: '30px', marginLeft: '10px' }}
onClick={() => {
model.fieldsDymic.splice(i, 1);
forceUpdate()
}}
>
Delete
Expand All @@ -35,6 +36,7 @@ export default function App() {
onClick={() => {
const len = model.fieldsDymic.length;
model.fieldsDymic.push({ value: len, uid: getUuid() });
forceUpdate()
}}
>
add
Expand Down

0 comments on commit 7d636c1

Please sign in to comment.