0

import React from 'react'
import { Link } from 'react-router-dom'

export default function NavBar() {
  return (
    <div className='NavContainer'>
        <link to='/home'>Home</link>
        <link to='/login'>Login</link>
        <link to='/register'>Register</link>
        <link to='/profile'>Profile</link>
        <link to='/admin'>Admin</link>
        <link to='/logout'>Logout</link>
    </div>
  )
}

but i keep gettin error on the "to" that....

Type '{ children: string; to: string; }' is not assignable to type 'DetailedHTMLProps<LinkHTMLAttributes, HTMLLinkElement>'. Property 'to' does not exist on type 'DetailedHTMLProps<LinkHTMLAttributes, HTMLLinkElement>'.

Nasiru Ismail
  • 37
  • 1
  • 4

1 Answers1

1

Try to use a capital L for the link tag, like this:

<Link to='/home'>Home</Link>