Skip to content

Commit

Permalink
type fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
stutrek committed Oct 8, 2024
1 parent 840758b commit 6d6efa8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
7 changes: 3 additions & 4 deletions docs/src/app/demos/petrock/sequence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,9 @@ export const pages: SequenceChild<
isRequired: (data) => !!data.registration?.rockDetails?.isAccessorized,
isComplete: (data) =>
!data.registration?.rockDetails?.isAccessorized ||
(!!data.accessoryInventory &&
data.accessoryInventory.accessories.every(
(accessory) => !!accessory?.type,
)),
!!data.accessoryInventory?.accessories?.every(
(accessory) => !!accessory?.type,
),
Component: AccessoryInventoryForm,
},
{
Expand Down
2 changes: 2 additions & 0 deletions docs/src/components/FormContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type {
UseFormWatch,
Resolver,
UseFormReturn,
DeepPartial,
} from 'react-hook-form';
import { useForm } from 'react-hook-form';
import { useMultiPageHookForm } from '../../../src/hookForm';
Expand Down Expand Up @@ -90,6 +91,7 @@ export function FormContainer<DataT extends FieldValues>({
<div>
<h3 className="mt-0">Full Sequence</h3>
<SequenceVisualizer
// @ts-expect-error
data={watch()}
currentPage={currentPage}
pages={pages}
Expand Down
9 changes: 2 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"version": "0.1.1",
"description": "Tools to handle multi-page forms",
"main": "dist/index.js",
"files": [
"dist"
],
"files": ["dist"],
"scripts": {
"build": "tsc",
"build:watch": "tsc -w",
Expand All @@ -16,10 +14,7 @@
"test": "jest",
"test:watch": "jest --watch"
},
"keywords": [
"forms",
"multi-page"
],
"keywords": ["forms", "multi-page"],
"author": "Stu Kabakoff",
"license": "MIT",
"devDependencies": {
Expand Down

0 comments on commit 6d6efa8

Please sign in to comment.