Link component doesn't have "to" prop in types
See original GitHub issueThis 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)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@bestickley Ah good catch! Just created a PR to fix it: https://github.com/aws-amplify/amplify-ui/pull/1285
@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.