Skip to content

Commit

Permalink
fix(uniform): refactor From component
Browse files Browse the repository at this point in the history
  • Loading branch information
toxsick committed Apr 15, 2024
1 parent 46f41f5 commit af3d528
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
// pixels
// 'packages/pixels/**/*.{js,ts,tsx}': ['eslint', 'vitest related --run'],
'packages/pixels/**/*.{js,ts,tsx}': ['eslint', 'vitest related --run'],
// uniform
'packages/uniform/**/*.{js,ts,tsx}': ['eslint', 'vitest related --run'],
// veto
Expand Down
7 changes: 3 additions & 4 deletions packages/uniform/src/Form/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ const Form = ({
validation = undefined,
validationTrigger = 'all',
}: FormProps) => {
const trigger =
validationTrigger === 'all-instant' ? 'all' : validationTrigger;

const methods = useForm(
validation
? {
Expand All @@ -75,7 +72,9 @@ const Form = ({
// https://github.com/react-hook-form/resolvers/blob/master/zod/src/zod.ts
return { values: data || {}, errors: errors || {}, ...rest };
},
mode: trigger, // Validate form (default: all)
// set rhf mode
// see: https://react-hook-form.com/docs/useform#mode
mode: validationTrigger === 'all-instant' ? 'all' : validationTrigger,
}
: {
defaultValues: initialValues,
Expand Down
2 changes: 1 addition & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"include-component-in-tag": true,
"packages": {
"packages/pixels": {},
"packages/uniform": { "release-as": "0.0.1" },
"packages/uniform": {},
"packages/veto": {}
},
"separate-pull-requests": true
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"references": [
{ "path": "packages/config/storybook-config" },
{ "path": "packages/pixels" },
{ "path": "packages/uniform" },
{ "path": "packages/veto" }
],
"files": []
Expand Down

0 comments on commit af3d528

Please sign in to comment.