Skip to content

Commit

Permalink
Add useFormValuesAndExtraInfos hook
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilag committed Dec 13, 2023
1 parent ab465ed commit b5a015d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-recoil-form",
"version": "0.7.1",
"version": "0.7.2",
"license": "MIT",
"author": "Wit By Bit",
"main": "dist/index.js",
Expand Down
6 changes: 6 additions & 0 deletions src/FormProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,12 @@ export function useFormValues() {
return formValues;
}

export function useFormValuesAndExtraInfos() {
const formId = useContext(FormIdContext);
const { values, extraInfos } = useRecoilValue(formValuesAtom(formId));
return {values, extraInfos};
}

export function useInitialValues() {
const formId = useContext(FormIdContext);
const { values } = useRecoilValue(formInitialValuesAtom(formId));
Expand Down

0 comments on commit b5a015d

Please sign in to comment.