Capítulo 25 de 57
createLink builds a custom Link component with the same type parameters (type-safe to, params, search, etc.) as the built-in Link, letting you wrap a styled anchor, a UI library's link-like component (Chakra UI, Material-UI, Mantine, React Aria), or any other custom element while keeping full TanStack Router type safety and features like preload="intent".
createLink(Component): Wraps a base component (typically one that forwards props to an <a> or is itself link-like) and returns a component with Link's exact type parameters and prop interface.Link throughout a codebase; centralizes it into one reusable, type-safe custom component.createLink-produced component again to apply default props (e.g. preload={'intent'}) so all usages get preloading without repeating the prop.createLink any time you find yourself repeating the same wrapper/styling around Link, it preserves type safety instead of losing it via a generic prop-spread wrapper.createLink-based components remain compatible with router features like preload="intent", so UI-library-styled links don't have to sacrifice preloading behavior.<a href> elements.Link's core behavior and props that createLink preserves.