Skip to content

v3.0.0

Choose a tag to compare

@tatemz tatemz released this 28 Jul 13:43
· 25 commits to main since this release

What Changed?

  • strongLoader and strongAction functions expose callbacks succeed, fail, and redirect in a well-known object
  • Moved to effect library (away from fp-ts)
  • Expose useRouteLoaderData hook alias

Using the New Callbacks

import { strongLoader } from "remix-strong-routes";

const action = strongLoader<BarResponse, FooResponse, RedirectToLogin>(
  async ({ context, request, params }, { succeed, redirect, fail }) => {
    // ... Same as before
  }
);
import { strongAction } from "remix-strong-routes";

const action = strongAction<BarResponse, FooResponse, RedirectToLogin>(
  async ({ context, request, params }, { succeed, redirect, fail }) => {
    // ... Same as before
  }
);

Using the New Hook

import { StrongComponent } from "remix-strong-routes";

const Component: StrongComponent<FooResponse> = (props) => {
    const parentRouteData = parentRoute.useRouteLoaderData();

    return <></>;
};