question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Link component doesn't have "to" prop in types

See original GitHub issue

This issue is related to the amplify-ui@next for React.

The docs for the Link component, under the section Routing Libraries shows an example with react-router-dom:

import { Link } from '@aws-amplify/ui-react';
import {
  BrowserRouter as Router,
  Link as ReactRouterLink,
} from 'react-router-dom';

/* React Router Example */
<Router>
  <Link as={ReactRouterLink} to="/home">
    Home
  </Link>
</Router>;

When following the example in Typescript, the prop to gives error (see screenshot)

image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
joebuonocommented, Feb 9, 2022

@bestickley Ah good catch! Just created a PR to fix it: https://github.com/aws-amplify/amplify-ui/pull/1285

2reactions
Milan-Shahcommented, Dec 2, 2021

@dreamorosi We need to do some research for our link component to support child attribute. We will keep the ticket updated as soon as we bring it into our upcoming sprint.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Link] LinkProps missing component prop #29942 - GitHub
the LinkProps type does not include a component field. The ThemeOptions type is using LinkProps as the type for theme.components.MuiLink.
Read more >
reactjs - Property 'exact' does not exist on type - Stack Overflow
I have been through this same issue, the new React-Router doesn't support the exact keyword ...
Read more >
Type checking with TypeScript - React Navigation
To type check our screens, we need to annotate the navigation prop and the route prop received by a screen. The navigator packages...
Read more >
Migrating to React Router v6: A complete guide
Migrate your React Router applications from v5 to v6 with this in-depth guide, including a review of additions and improvements from v5.
Read more >
next/link | Next.js
Link accepts the following props: href - The path or URL to navigate to. This is the only required prop. It can also...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found