How can I disable a in react-router, if its URL already active? E.g. if my URL wouldn\'t change on a click on I want to p
You can use CSS's pointer-events attribute. This will work with most of the browsers. For example your JS code:
class Foo extends React.Component {
render() {
return (
Bar
);
}
}
and CSS:
.disabled-link {
pointer-events: none;
}
Links:
The How to disable HTML links answer attached suggested using both disabled and pointer-events: none for maximum browser-support.
a[disabled] {
pointer-events: none;
}
Link to source: How to disable Link