Skip to content

Commit

Permalink
examples: react-hook-form examples's refactor, ealry exit
Browse files Browse the repository at this point in the history
  • Loading branch information
AkifumiSato committed Sep 4, 2022
1 parent 0d9c56e commit ab48757
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/react-hook-form/src/hooks/useFormSync.ts
Expand Up @@ -26,10 +26,10 @@ export function useFormSync<TFieldValues extends FieldValues, TContext = any>(
({ snapshot }) =>
() => {
const formLoadable = snapshot.getLoadable(formState)
if (formLoadable.state === 'hasValue') {
return formLoadable.contents
if (formLoadable.state !== 'hasValue') {
throw new Error('useFormSync: not support async state.')
}
throw new Error('useFormSync: not support async state.')
return formLoadable.contents
},
[]
)
Expand Down

0 comments on commit ab48757

Please sign in to comment.