'Nav-Hash-Link always Active when the route is /home/#sampleproducts& /home/#dashboard [closed]

I want to add an active link using Nav-hash-link. But it's active always when I add the route like /home/#sampleproducts& /home/#dashboard.

import { NavHashLink as NavLink } from 'react-router-hash-link';
        <NavLink style = {navLink} to={'/#'}>Home</NavLink>
        <NavLink style = {navLink} to={'/home/#sampleproducts'}>Sample</NavLink>
        <NavLink style = {navLink} to={'/home/#dashboard'}>Dashboard</NavLink>

navLink function code

const navLink = ({isActive}) => {

return{ backgroundColor:isActive ? '#B31217' : '', color:isActive ? '#fff' : '' }



Solution 1:[1]

node.js is a program that allows you to run javascript code natively on a host system, where it would typically only be run in a browser. This makes it similar to other interpreted languages like python or php.

MongoDB is a database tool. If you have a lot of data that you need easily stored and accessible, you would likely look into a database tool. This is similar to sql or elasticsearch. Additionally, MongoDB can be used with almost every programming language out there, so you do not even need node.js to run it. You could have a program written in C# that stores all it's data with MongoDB.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 LadderTheory