-
-
Couldn't load subscription status.
- Fork 10.7k
feat: Add Remix Data APIs #8855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* feat: add initial empty history package * feat: add createMemoryHistory + tests * chore: add rollup buld for history * chore: change state type from unknown -> any * feat: Change listen interface to be pop only * chore: fix lint warning * Add history package to yarn workspace * chore: Address PR feedback
Additional notes: - adds unique route id generation to react-router - enhances test harness to manage at navigation level - combines error/catch into a single exception
This one was tricky: - react-router-native used to find the type for URLSearchParams from @types/react-native - The new history work added @types/jsdom - react-router-native now finds that URLSearchParams before the @types/react-native one - the jsdom one imports from the internal built-in TS DOM lib - but it does not include the DOM.Iterable values such as keys See: microsoft/TypeScript#38139
- loader/action - useLoaderData/useActionData/useTransition - exceptionElement/useRouteException - fallbackElement
This reverts commit a887019.
Done in steps via grep/sed: - exceptionElement -> errorElement - useRouteException -> useRouteError - Exception -> Error - exceptions -> errors - exception -> error
feat: change defaultShouldRevalidate from funciton -> boolean chore: simplify revalidation via isRevalidationRequired
Copies the changes from remix remix-run/remix#3094
* feat: add pending logic to NavLink * chore: fixup type imports * chore: add useMemo to nextMatch calculation
|
|
||
| export function useFormAction(action = "."): string { | ||
| let routeContext = React.useContext(UNSAFE_RouteContext); | ||
| invariant(routeContext, "useLoaderData must be used inside a RouteContext"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| invariant(routeContext, "useLoaderData must be used inside a RouteContext"); | |
| invariant(routeContext, "useFormAction must be used inside a RouteContext"); |
Drive by comment while looking at the new goodies 🚗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! We've rebased this branch so I fixed this over in the new branch 👍
|
Closing to work off the newly rebased branch |
Merging the feature branch for https://remix.run/blog/remixing-react-router
@remix-run/routerpackage (with included history APIs)react-routerviaDataMemoryRouterand associated hooksuseActionDatauseLoaderDatauseMatchesuseNavigationuseRevalidatoruseRouteErroruseRouteLoaderDatareact-router-domviaDataBrowserRouter/DataHashRouter, plus a few additional components/hooks on top of the above<Form><ScrollRestoration>useFetcher/useFetchersuseSubmit