Skip to content

Conversation

@LekoArts
Copy link
Contributor

@LekoArts LekoArts commented Jan 8, 2025

Description

Previously such usage would have thrown type errors:

export async function loader(args: Route.LoaderArgs) {
  return rootAuthLoader(args, async () => {
    return data({ title: "React Router Clerk Starter" }, { headers: {} });
  })
}

export function Layout({ children }: { children: React.ReactNode }) {
  const data = useRouteLoaderData<typeof loader>('root')

  return (
    // TODO
  );
}

We didn't account for the return type of the data() utility in our types. This should work now 👍

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot
Copy link

changeset-bot bot commented Jan 8, 2025

🦋 Changeset detected

Latest commit: b6eb0bb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/react-router Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jan 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ⬜️ Skipped (Inspect) Jan 8, 2025 2:41pm

@LekoArts LekoArts merged commit 620b8d2 into main Jan 8, 2025
35 checks passed
@LekoArts LekoArts deleted the lekoarts/eco-284-react-router-type-error-for-data-utility branch January 8, 2025 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants