Tutorial guidance. QueryNavLink #8891
-
Can someone please help me understand this. When i replace my previous Navlink, it breaks the code because i'm not sure what parameters i'm supposed to enter. Also i've never seen NavLink with an unassigned object in it, what ...props are being entered? how do i utilise this in the code? The input seem's to be an object or destructuring. The tutorial has been clear and concise up until this point, been stuck for hours lol
Here it is in context
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
As I replied in Discord They basically want you to replace the .map((invoice) => (
<QueryNavLink
style={({ isActive }) => ({
display: "block",
margin: "1rem 0",
color: isActive ? "red" : "",
})}
to={`/invoices/${invoice.number}`}
key={invoice.number}
>
{invoice.name}
</QueryNavLink>
))} |
Beta Was this translation helpful? Give feedback.
As I replied in Discord
They basically want you to replace the
<NavLink/>
component with your new<QueryNavLink/>
component. No other changes needed. Remember components aren't regular functions. You invoke them via JSX and pass props.