Just wanted to leave this in the community in case anyone is wanting to leverage the useFormFields functionality like useState;
const [status, setStatus]: [string, (value: string) => void] = useFormFields(([fields, dispatch]) => [
fields.status.value as string, (value: string) => dispatch({ type: 'UPDATE', path: 'status', value: value })
]);
This will allow you to use status to get the value, and setStatus('') to make changes to your other form values.
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.