Open
Description
I was looking at incorporating into an existing FormWizard
component that uses RHF and is used in many places across our application. I’ve added a persistKey
prop (string) that, when present, would just be used to enable form persist within that instance of the wizard. Like this:
if (persistKey && typeof persistKey === 'string') {
useFormPersist(persistKey, {
setValue,
watch,
});
}
However, it’s not recommended to conditionally apply hooks in a component, so what would be the recommended process here?
I was considering forking the project and adding something like this to the two useEffect
blocks:
if (!name) return
Thoughts?
Metadata
Metadata
Assignees
Labels
No labels