Skip to content

Commit e2aa55e

Browse files
authored
fix(@uform/react): fix unmount (#436)
* fix(@uform/react): fix unmount * fix(@uform/react): fix unmount * fix(@uform/react): update docs
1 parent 19e2627 commit e2aa55e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/react/src/hooks/useField.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const useField = (options: IFieldStateUIProps): IFieldHook => {
9494
ref.current.field.unsubscribe(ref.current.subscriberId)
9595
ref.current.field.setState((state: IFieldState) => {
9696
state.unmounted = true
97-
}, true)
97+
})//must notify,need to trigger remove value
9898
}
9999
}, [])
100100

packages/react/src/hooks/useVirtualField.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const useVirtualField = (
5656
ref.current.field.unsubscribe()
5757
ref.current.field.setState((state: IVirtualFieldState) => {
5858
state.unmounted = true
59-
}, true)
59+
})//must notify,need to trigger remove value
6060
}
6161
}, [])
6262

0 commit comments

Comments
 (0)