Files
UiQuestions/components/Link.jsx
T
2020-10-26 17:23:40 +05:30

18 lines
338 B
React

import React from "react";
const Link = ({ hash, title }) => {
const handleLink = (event) => {
//manually change hash to trigger hashChange event.
window.location.hash = "#";
window.location.hash = hash;
};
return (
<a onClick={handleLink} className="navlink">
{title}
</a>
);
};
export default Link;