Skip to content
Closed
Changes from all 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
34 changes: 34 additions & 0 deletions apps/docs/src/lib/storybook/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Storybook Mocks

This directory contains mock implementations for React Router components and types that were previously imported from @remix-run packages.

## remix-mock.tsx

This file provides mock implementations for:

1. Types that were previously from @remix-run/node:
- ActionFunction
- ActionFunctionArgs
- LoaderFunction
- LinksFunction
- MetaFunction

2. Components that were previously from @remix-run/react:
- Form
- useFetcher

3. Utilities that were previously from @remix-run/testing:
- createRemixStub

## remix-stub.tsx

This file provides a decorator for Storybook stories that need to use the React Router components and types.

## Migration from Remix to React Router

As part of the migration from Remix to React Router v7, we've replaced all @remix-run imports with our own mock implementations that use React Router components under the hood. This approach allows us to:

1. Remove all @remix-run dependencies from the docs app
2. Fix build errors when running `yarn build-storybook`
3. Maintain compatibility with existing code that uses Remix components and types
4. Simplify the codebase by using a single routing library
Loading