Skip to content

Include react-router/dom APIs in typedoc #13509

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
7 changes: 5 additions & 2 deletions packages/react-router-dom/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import type { RouterProviderProps } from "react-router/dom";
import type {
HydratedRouterProps,
RouterProviderProps,
} from "react-router/dom";
import { HydratedRouter, RouterProvider } from "react-router/dom";

// TODO: Confirm if this causes tree-shaking issues and if so, convert to named exports
export type * from "react-router";
export * from "react-router";

export type { RouterProviderProps };
export type { HydratedRouterProps, RouterProviderProps };
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exported so they get included in the typedoc output as a clickable link in the HydratedRouter page

export { HydratedRouter, RouterProvider };
1 change: 1 addition & 0 deletions packages/react-router/dom-export.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export type { RouterProviderProps } from "./lib/dom-export/dom-router-provider";
export { RouterProvider } from "./lib/dom-export/dom-router-provider";
export type { HydratedRouterProps } from "./lib/dom-export/hydrated-router";
export { HydratedRouter } from "./lib/dom-export/hydrated-router";
2 changes: 1 addition & 1 deletion packages/react-router/lib/dom-export/hydrated-router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ function createHydratedRouter({
return router;
}

interface HydratedRouterProps {
export interface HydratedRouterProps {
/**
* Context object to passed through to `createBrowserRouter` and made available
* to `clientLoader`/`clientActon` functions
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router/typedoc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"entryPoints": ["./index.ts"],
"entryPoints": ["./index.ts", "./dom-export.ts"],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This doesn't do quite what I would have hoped :/. It adds another level of nesting under react-router:

Screenshot 2025-04-30 at 2 08 03 PM

Unsure if theres any way to flatten that to:

react-router
  ...All the current stuff
react-router/dom
  ...New Stuff

"categoryOrder": [
"Components",
"Hooks",
Expand Down