Closed pzmosquito closed 6 years ago
Hello, I'll take a look. Could you create a jsbin or similar to reproduce the problem?
Thanks, in your event handler you should prevent the default browser action:
const TestBaseLink = () => {
const handleClick = (e) => {
e.preventDefault()
console.log("test");
};
return <BaseLink onClick={handleClick}>test baselink</BaseLink>;
};
render(<TestBaseLink />, document.getElementById("root"));
Uhhh... How on earth did I forget about that... Thanks for pointing it out.
according to the documentation, the
BaseLink
component should not requirerouter
orrouterStore
ifonClick
prop is passed in. It's giving errorthis.router is null
on Firefox andUncaught TypeError: Cannot read property 'navigate' of null
on Chrome