disabling navlink react router : <p>I am using react router in and I want to disable the to attribute in a certain state. I passed empty string, but that doesn't disable the link instead it takes to the base route of the page. I even tried to pass null but that breaks the code. Is it even possible to do so?</p>

<pre><code>&lt;NavLink className="nav-link" to={this.state.role == 4 ? "/pages" : ""}&gt;&lt;/NavLink&gt;
</code></pre>
