Complete the code to create a navigation link using React Router.
import { Link } from 'react-router-dom'; function Nav() { return <Link to=[1]>Home</Link>; }
The to prop in Link specifies the path. The root path is "/".
Complete the code to add a navigation link to the About page.
import { Link } from 'react-router-dom'; function Nav() { return <Link to=[1]>About</Link>; }
The path should start with a slash and be lowercase for consistency: "/about".
Fix the error in the navigation link to correctly navigate to the Contact page.
import { Link } from 'react-router-dom'; function Nav() { return <Link to=[1]>Contact</Link>; }
The to prop must be a string starting with a slash to define the path correctly.
Fill both blanks to create navigation links for Home and Profile pages.
import { Link } from 'react-router-dom'; function Nav() { return ( <nav> <Link to=[1]>Home</Link> <Link to=[2]>Profile</Link> </nav> ); }
The Home link uses the root path "/", and the Profile link uses "/profile".
Fill all three blanks to create navigation links for Dashboard, Settings, and Logout pages.
import { Link } from 'react-router-dom'; function Nav() { return ( <nav> <Link to=[1]>Dashboard</Link> <Link to=[2]>Settings</Link> <Link to=[3]>Logout</Link> </nav> ); }
Each link's to prop should be a string starting with a slash for the correct path.
