javascript - react-router: How to disable a <Link>, if its active? - Stack Overflow

PHOTO EMBED

Fri Apr 29 2022 10:25:04 GMT+0000 (Coordinated Universal Time)

Saved by @ebpsalm #javascript

class Foo extends React.Component {
  render() {
    return (
      <Link to='/bar' className='disabled-link'>Bar</Link>
    );
  }
}
AND CSS 
.disabled-link {
  pointer-events: none;
}
content_copyCOPY

https://stackoverflow.com/questions/35963070/react-router-how-to-disable-a-link-if-its-active