TanStackT
TanStack8mo ago
7 replies
technical-ivory

defaultValue and defalutState.value

Hi guys, I have question regarding filling up initial form values

While using form I had this expectation for my needs:
defaultValue: the 'empty' value of each field, for example when there is no defaultState.value the defaultValue is used as initial value or when user resets the form the defaultValue is used
defaultState.value: the 'initial' value for each field, for example when I want to prefill certain fields or load the values from datasource for 'edit mode'.

However when I fill both defaultValue and defaultState.value, defaultState.value is ignored and only defaultValue is used.
Is there any api or recommended method existing to provide what I want? or if not maybe I or someone could propose spec for it.
Was this page helpful?