Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- `yarn build`: Build all packages/apps.
- `yarn serve`: Serve built Storybook (`apps/docs`).
- `yarn test`: Run workspace tests (Storybook test-runner in `apps/docs`).
- `yarn format-and-lint` | `:fix`: Check/auto-fix with Biome.
- `yarn lint` | `:fix`: Check/auto-fix with Biome.
- Per workspace (examples):
- `yarn workspace @lambdacurry/forms build`
- `yarn workspace @lambdacurry/forms-docs dev`
Expand All @@ -34,7 +34,7 @@
- Commits: short imperative subject, optional scope, concise body explaining rationale.
- Example: `Fix: remove deprecated dropdown select`.
- PRs: clear description, linked issues, screenshots or Storybook links, notes on testing.
- Required checks: `yarn format-and-lint` passes; build succeeds; tests updated/added.
- Required checks: `yarn lint` passes; build succeeds; tests updated/added.
- Versioning: when changing published package(s), add a Changeset (`yarn changeset`) before merge.

## Security & Configuration
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/examples/middleware-example.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { zodResolver } from '@hookform/resolvers/zod';
import { TextField } from '@lambdacurry/forms/remix-hook-form';
import type { ActionFunctionArgs } from 'react-router';
// Example of using the new middleware feature in remix-hook-form v7.0.0
import { Form } from 'react-router';
import type { ActionFunctionArgs } from 'react-router';
import { RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { getValidatedFormData } from 'remix-hook-form/middleware';
import * as zod from 'zod';
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/lib/storybook/react-router-stub.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import type { Decorator } from '@storybook/react-vite';
import type { ComponentType } from 'react';
import {
type ActionFunction,
createRoutesStub,
type LinksFunction,
type LoaderFunction,
type MetaFunction,
createRoutesStub,
} from 'react-router';

export interface StubRouteObject {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { Meta, StoryObj } from '@storybook/react-vite';
import { expect, userEvent, within } from '@storybook/test';
import * as React from 'react';
import { type ActionFunctionArgs, Form, useFetcher } from 'react-router';
import { RemixFormProvider, createFormData, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { createFormData, getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/remix-hook-form/checkbox-custom.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { expect, userEvent, within } from '@storybook/test';
import type * as React from 'react';
import type { ActionFunctionArgs } from 'react-router';
import { useFetcher } from 'react-router';
import { RemixFormProvider, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/remix-hook-form/checkbox-list.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Button } from '@lambdacurry/forms/ui/button';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { expect, userEvent, type within } from '@storybook/test';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Invalid type within import breaks types

within is a value export; importing it as a type is invalid. Either import the value or use a typeof import in the type.

-import { expect, userEvent, type within } from '@storybook/test';
+import { expect, userEvent, within } from '@storybook/test';

And keep the type use as ReturnType<typeof within> (now valid). If you prefer to avoid a value import purely for types:

type StoryContext = {
  canvas: ReturnType<typeof import('@storybook/test').within>;
};
πŸ€– Prompt for AI Agents
In apps/docs/src/remix-hook-form/checkbox-list.stories.tsx around line 6, the
import incorrectly imports "within" as a type which is a runtime value; change
the import to import { expect, userEvent, within } from '@storybook/test'
(remove the "type" qualifier) and update any type usages to use
ReturnType<typeof within> (or, if you must avoid a value import, switch the type
to: canvas: ReturnType<typeof import('@storybook/test').within>).

import { type ActionFunctionArgs, Form, useFetcher } from 'react-router';
import { RemixFormProvider, createFormData, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { createFormData, getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/remix-hook-form/checkbox.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button } from '@lambdacurry/forms/ui/button';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { expect, userEvent, within } from '@storybook/test';
import { type ActionFunctionArgs, useFetcher } from 'react-router';
import { RemixFormProvider, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import { columnConfigs, columns } from './data-table-stories.components';
import {
DataTable,
DataTableFilter,
type MockIssue,
type OnChangeFn,
type PaginationState,
type SortingState,
getCoreRowModel,
getPaginationRowModel,
getSortedRowModel,
type MockIssue,
mockDatabase,
type OnChangeFn,
type PaginationState,
type SortingState,
useDataTableFilters,
useFilterSync,
useReactTable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,7 @@ export default meta;
type Story = StoryObj<typeof meta>;

export const Default: Story = {
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
args: {} as any, // Args for DataTableRouterForm if needed, handled by Example component
args: {} satisfies Record<string, unknown>, // Args for DataTableRouterForm if needed, handled by Example component
render: () => <DataTableRouterFormExample />,
parameters: {
docs: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ import { useMemo } from 'react';
import { type LoaderFunctionArgs, useLoaderData, useSearchParams } from 'react-router';
import { columnConfigs, columns } from './data-table-stories.components';
import {
calculateFacetedCounts,
type DataResponse,
DataTable,
DataTableFilter,
type MockIssue,
type OnChangeFn,
type PaginationState,
type SortingState,
calculateFacetedCounts,
dataTableRouterParsers,
filtersArraySchema,
getCoreRowModel,
getPaginationRowModel,
getSortedRowModel,
type MockIssue,
mockDatabase,
type OnChangeFn,
type PaginationState,
type SortingState,
useDataTableFilters,
useFilterSync,
useReactTable,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import type { ColumnDef } from '@tanstack/react-table';
import {
assigneeOptions,
CalendarIcon,
CheckCircledIcon,
createColumnConfigHelper,
DataTableColumnHeader,
type MockIssue,
PersonIcon,
StarIcon,
TextIcon,
assigneeOptions,
createColumnConfigHelper,
priorityOptions,
StarIcon,
statusOptions,
TextIcon,
} from './data-table-stories.helpers';

// --- Column Configuration ---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,16 +218,16 @@ export const priorityOptions = [

// --- Shared Imports (for re-export) ---
export { dataTableRouterParsers } from '@lambdacurry/forms/remix-hook-form/data-table-router-parsers';
export { DataTable } from '@lambdacurry/forms/ui/data-table/data-table';
export { DataTableColumnHeader } from '@lambdacurry/forms/ui/data-table/data-table-column-header';
export { DataTableFilter } from '@lambdacurry/forms/ui/data-table-filter/components/data-table-filter';
export { createColumnConfigHelper } from '@lambdacurry/forms/ui/data-table-filter/core/filters';
export { useDataTableFilters } from '@lambdacurry/forms/ui/data-table-filter/hooks/use-data-table-filters';
export { DataTable } from '@lambdacurry/forms/ui/data-table/data-table';
export { DataTableColumnHeader } from '@lambdacurry/forms/ui/data-table/data-table-column-header';
export type { FiltersState } from '@lambdacurry/forms/ui/utils/filters';
export { filtersArraySchema } from '@lambdacurry/forms/ui/utils/filters';
export { useFilterSync } from '@lambdacurry/forms/ui/utils/use-filter-sync';
export { CalendarIcon, CheckCircledIcon, PersonIcon, StarIcon, TextIcon } from '@radix-ui/react-icons';
export type { ColumnDef, PaginationState, SortingState, OnChangeFn } from '@tanstack/react-table';
export type { ColumnDef, OnChangeFn, PaginationState, SortingState } from '@tanstack/react-table';
export { getCoreRowModel, getPaginationRowModel, getSortedRowModel, useReactTable } from '@tanstack/react-table';
export { useMemo } from 'react';
export { type LoaderFunctionArgs, useLoaderData, useLocation, useNavigate, useSearchParams } from 'react-router';
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/remix-hook-form/date-picker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button } from '@lambdacurry/forms/ui/button';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { expect, userEvent, within } from '@storybook/test';
import { type ActionFunctionArgs, Form, useFetcher } from 'react-router';
import { RemixFormProvider, createFormData, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { createFormData, getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/remix-hook-form/form-error-basic.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button } from '@lambdacurry/forms/ui/button';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { expect, userEvent, within } from '@storybook/test';
import { type ActionFunctionArgs, useFetcher } from 'react-router';
import { RemixFormProvider, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
11 changes: 9 additions & 2 deletions apps/docs/src/remix-hook-form/form-error-custom.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Button } from '@lambdacurry/forms/ui/button';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { expect, userEvent, within } from '@storybook/test';
import { type ActionFunctionArgs, useFetcher } from 'react-router';
import { RemixFormProvider, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand All @@ -19,7 +19,14 @@ type FormData = z.infer<typeof formSchema>;
// Custom error message component with icon
const AlertErrorMessage = (props: React.ComponentProps<typeof FormMessage>) => (
<div className="flex items-center p-4 bg-red-50 border-l-4 border-red-400 rounded-md">
<svg className="h-5 w-5 text-red-400 mr-3" viewBox="0 0 20 20" fill="currentColor">
<svg
className="h-5 w-5 text-red-400 mr-3"
viewBox="0 0 20 20"
fill="currentColor"
role="img"
aria-labelledby="alert-icon-title"
>
<title id="alert-icon-title">Error</title>
<path
fillRule="evenodd"
d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z"
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/remix-hook-form/form-error-mixed.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button } from '@lambdacurry/forms/ui/button';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { expect, userEvent, within } from '@storybook/test';
import { type ActionFunctionArgs, useFetcher } from 'react-router';
import { RemixFormProvider, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button } from '@lambdacurry/forms/ui/button';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { expect, userEvent, within } from '@storybook/test';
import { type ActionFunctionArgs, useFetcher } from 'react-router';
import { RemixFormProvider, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/remix-hook-form/form-error.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { FormError, TextField } from '@lambdacurry/forms';
import { Button } from '@lambdacurry/forms/ui/button';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { type ActionFunctionArgs, useFetcher } from 'react-router';
import { RemixFormProvider, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
13 changes: 7 additions & 6 deletions apps/docs/src/remix-hook-form/form-error.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { render, screen } from '@testing-library/react';
import { useFetcher } from 'react-router';
import { RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import type { ElementType, PropsWithChildren } from 'react';

// Mock useFetcher
jest.mock('react-router', () => ({
Expand All @@ -30,14 +31,14 @@ const TestFormWithError = ({
}: {
initialErrors?: Record<string, { message: string }>;
formErrorName?: string;
customComponents?: any;
customComponents?: { FormMessage?: React.ComponentType<PropsWithChildren<Record<string, unknown>>> };
className?: string;
}) => {
const mockFetcher = {
data: { errors: initialErrors },
state: 'idle' as const,
submit: jest.fn(),
Form: 'form' as any,
Form: 'form' as ElementType,
};

mockUseFetcher.mockReturnValue(mockFetcher);
Expand Down Expand Up @@ -142,7 +143,7 @@ describe('FormError Component', () => {

describe('Component Customization', () => {
it('uses custom FormMessage component when provided', () => {
const CustomFormMessage = ({ children, ...props }: any) => (
const CustomFormMessage = ({ children, ...props }: PropsWithChildren<Record<string, unknown>>) => (
<div data-testid="custom-form-message" className="custom-message" {...props}>
Custom: {children}
</div>
Expand Down Expand Up @@ -216,7 +217,7 @@ describe('FormError Component', () => {
},
state: 'idle' as const,
submit: jest.fn(),
Form: 'form' as any,
Form: 'form' as ElementType,
};

mockUseFetcher.mockReturnValue(mockFetcher);
Expand Down Expand Up @@ -314,7 +315,7 @@ describe('FormError Component', () => {
it('does not re-render unnecessarily when unrelated form state changes', () => {
const renderSpy = jest.fn();

const CustomFormMessage = ({ children, ...props }: any) => {
const CustomFormMessage = ({ children, ...props }: PropsWithChildren<Record<string, unknown>>) => {
renderSpy();
return <div {...props}>{children}</div>;
};
Expand Down Expand Up @@ -344,7 +345,7 @@ describe('FormError Integration Tests', () => {
data: null,
state: 'idle' as const,
submit: jest.fn(),
Form: 'form' as any,
Form: 'form' as ElementType,
};

mockUseFetcher.mockReturnValue(mockFetcher);
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/remix-hook-form/otp-input.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button } from '@lambdacurry/forms/ui/button';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { expect, userEvent, within } from '@storybook/test';
import { type ActionFunctionArgs, Form, useFetcher } from 'react-router';
import { RemixFormProvider, createFormData, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { createFormData, getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/remix-hook-form/password-field.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { Meta, StoryContext, StoryObj } from '@storybook/react-vite';
import { expect, userEvent } from '@storybook/test';
import { useRef } from 'react';
import { type ActionFunctionArgs, useFetcher } from 'react-router';
import { RemixFormProvider, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/remix-hook-form/phone-input.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button } from '@lambdacurry/forms/ui/button';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { expect, userEvent, within } from '@storybook/test';
import { type ActionFunctionArgs, useFetcher } from 'react-router';
import { RemixFormProvider, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
7 changes: 4 additions & 3 deletions apps/docs/src/remix-hook-form/phone-input.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import userEvent from '@testing-library/user-event';
import { useFetcher } from 'react-router';
import { RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import type { ElementType, PropsWithChildren } from 'react';

// Mock useFetcher
jest.mock('react-router', () => ({
Expand All @@ -28,13 +29,13 @@ const TestPhoneInputForm = ({
customComponents = {},
}: {
initialErrors?: Record<string, { message: string }>;
customComponents?: any;
customComponents?: { FormMessage?: React.ComponentType<PropsWithChildren<Record<string, unknown>>> };
}) => {
const mockFetcher = {
data: { errors: initialErrors },
state: 'idle' as const,
submit: jest.fn(),
Form: 'form' as any,
Form: 'form' as ElementType,
};

mockUseFetcher.mockReturnValue(mockFetcher);
Expand Down Expand Up @@ -151,7 +152,7 @@ describe('PhoneInput Component', () => {

describe('Component Customization', () => {
it('uses custom FormMessage component when provided', () => {
const CustomFormMessage = ({ children, ...props }: any) => (
const CustomFormMessage = ({ children, ...props }: PropsWithChildren<Record<string, unknown>>) => (
<div data-testid="custom-form-message" className="custom-message" {...props}>
Custom: {children}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { expect, userEvent, within } from '@storybook/test';
import { type ActionFunctionArgs, Form, useFetcher } from 'react-router';
import { RemixFormProvider, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/remix-hook-form/radio-group.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Button } from '@lambdacurry/forms/ui/button';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { expect, userEvent, within } from '@storybook/test';
import { type ActionFunctionArgs, Form, useFetcher } from 'react-router';
import { RemixFormProvider, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
Comment on lines 7 to 9
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Use fetcher.Form instead of Form to wire responses to useFetcher.

You render <Form> while reading fetcher.data. This won’t populate fetcher.data. Use <fetcher.Form> and drop the Form import per docs guidelines.

-import { type ActionFunctionArgs, Form, useFetcher } from 'react-router';
+import { type ActionFunctionArgs, useFetcher } from 'react-router';
@@
-      <Form onSubmit={methods.handleSubmit}>
+      <fetcher.Form onSubmit={methods.handleSubmit}>
@@
-      </Form>
+      </fetcher.Form>

Also applies to: 64-66

πŸ€– Prompt for AI Agents
In apps/docs/src/remix-hook-form/radio-group.stories.tsx around lines 7-9 and
also apply to lines 64-66, you are importing and rendering the plain <Form>
while reading fetcher.data which prevents fetcher from populating response data;
remove the Form import from the top, keep useFetcher, and replace any <Form>
usage with <fetcher.Form> in the JSX so responses are wired into fetcher.data
(ensure the component uses the fetcher variable from useFetcher and adjust
imports accordingly).

import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/remix-hook-form/scroll-to-error.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Textarea } from '@lambdacurry/forms/remix-hook-form/textarea';
import { Button } from '@lambdacurry/forms/ui/button';
import type { Meta, StoryObj } from '@storybook/react-vite';
import { type ActionFunctionArgs, useFetcher } from 'react-router';
import { RemixFormProvider, getValidatedFormData, useRemixForm, useRemixFormContext } from 'remix-hook-form';
import { getValidatedFormData, RemixFormProvider, useRemixForm, useRemixFormContext } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/remix-hook-form/select-custom.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { expect, userEvent, within } from '@storybook/test';
import clsx from 'clsx';
import * as React from 'react';
import { type ActionFunctionArgs, useFetcher } from 'react-router';
import { RemixFormProvider, getValidatedFormData, useRemixForm } from 'remix-hook-form';
import { getValidatedFormData, RemixFormProvider, useRemixForm } from 'remix-hook-form';
import { z } from 'zod';
import { withReactRouterStubDecorator } from '../lib/storybook/react-router-stub';

Expand Down
Loading