What is Navlink Activeclassname? The Navlink React component enables declarative routing for your application. It produces a Link element with its href defined by the activeClassName property.
The navlink activeClassName prop receives a string that will be used as the value for the rendered Link element's className property.
The activeClassName property is used to add a class name to an active Link element. The activeClassName property determines the class name. If the activeClassName property is not given, "active" is used as the default class name.
The element's class name is applied when the Link element is active. If the activeClassName property is not given, "active" is used as the default class name.
The activeClassName property may be used to customise an active Link element. The following code, for instance, sets the active class name to "selected": This property may also be used to style the Link element while it is not active.
For instance, the following code changes the name of an inactive class to "not-selected":
The Navlink component supports the other properties of the React Router Link component, in addition to the activeClassName prop. Refer to the documentation for React Router for further details on the active class in react Link component.
Share a personalized message with your friends.