Skip to content

Commit

Permalink
chore: export unstable hook
Browse files Browse the repository at this point in the history
  • Loading branch information
airjp73 committed Sep 11, 2024
1 parent 6afa746 commit b4f26f5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 4 additions & 1 deletion packages/react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ export {
useFormScopeOrContext,
} from "./context";
export { useFormScope } from "./useFormScope";
export { useNativeValidity } from "./useNativeValidity";
export {
useNativeValidity,
useNativeValidityForForm as unstable_useNativeValidityForForm,
} from "./useNativeValidity";
export { Isolate } from "./isolation";
export * from "./compatability/misc";
2 changes: 1 addition & 1 deletion packages/react/src/test/use-native-validity.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useId, useRef, useState } from "react";
import {
useNativeValidity,
unstable_useNativeValidityForForm as useNativeValidityForForm,
useNativeValidityForForm,
} from "../useNativeValidity";
import { render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
Expand Down
4 changes: 1 addition & 3 deletions packages/react/src/useNativeValidity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const useNativeValidity = (
* If you need more granular control over which fields use this method,
* you can use `useNativeValidity` instead for each input.
*/
const useNativeValidityForForm = (scope: FormScope<any>) => {
export const useNativeValidityForForm = (scope: FormScope<any>) => {
useEffect(() => {
return scope.__store__.store.subscribe((state, prevState) => {
const currentErrors = state.validationErrors;
Expand Down Expand Up @@ -75,5 +75,3 @@ const useNativeValidityForForm = (scope: FormScope<any>) => {
});
}, [scope]);
};

export const unstable_useNativeValidityForForm = useNativeValidityForForm;

0 comments on commit b4f26f5

Please sign in to comment.