Skip to content
Source
Sign inSign up
TanStack/router

docs: `createLink` has no API reference page; 3 how-to guides link to a missing `#createlink` anchor #8766

Openravitejas-tech(GitHub profile, opens in a new tab) opened this issue 0 comments

Which project does this relate to?

Router

Describe the bug

createLink is exported from @tanstack/react-router (packages/react-router/src/index.tsx), but it has no API reference page. Functions like createRoute, linkOptions and redirect each have a page listed in docs/router/api/router.md; createLink is not listed there, and no file under docs/router/api/ mentions it. It is only documented in the Custom Link guide (docs/router/guide/custom-link.md).

Three how-to guides link to it anyway, using an anchor that doesn't exist:

  • docs/router/how-to/integrate-chakra-ui.md line 822
  • docs/router/how-to/integrate-material-ui.md line 716
  • docs/router/how-to/integrate-shadcn-ui.md line 516

Each one is: [TanStack Router createLink API](../api/router#createlink)

There is no createlink heading or entry in docs/router/api/router.md, so the link does not lead to any createLink documentation.

Proposed fix:

  1. Add docs/router/api/router/createLinkFunction.md, following the format of the other function pages.
  2. List it under "Functions" in docs/router/api/router.md.
  3. Point the three how-to links to the new page.

I'd like to work on this and open a PR.

Complete minimal reproducer

https://github.com/TanStack/router/blob/d9b07e8d3b724cdbfac0aa2fba4c1f7a3a241100/docs/router/how-to/integrate-chakra-ui.md?plain=1#L822

Steps to Reproduce the Bug

  1. Open docs/router/how-to/integrate-chakra-ui.md and go to line 822 (the "Related Resources" section). The same link is in integrate-material-ui.md line 716 and integrate-shadcn-ui.md line 516.
  2. See the link [TanStack Router createLink API](../api/router#createlink).
  3. Open docs/router/api/router.md: there is no createLink entry or heading in the Functions list.
  4. Search docs/router/api/ for "createLink": no results.

Expected behavior

The "TanStack Router createLink API" links lead to an API reference page for createLink, like the pages that exist for createRoute, linkOptions and redirect.

Screenshots or Videos

No response

Platform

N/A, documentation issue

  • Router version: main branch (commit d9b07e8)

Additional context

No response

Sign in to join this conversation.