Is empty string valid value for React Link?
问题 I'm writing a React.js application where I want to use Link component from react-router package in order to conditionally redirect a user to another page. If some condition doesn't hold I set the to prop to empty string which works and doesn't cause page reload and the page stays in the exact same place it was. But I'm wondering if this is the best practice? This is my solution: import { Link } from 'react-router'; <Link to={condition === true ? '/some/other/url' : ''}> <div> my content </div