Link - reformat

This commit is contained in:
2020-10-26 17:23:40 +05:30
parent 5a8cbef517
commit 4117131c12
+14 -12
View File
@@ -1,15 +1,17 @@
import React from "react" import React from "react";
const Link = ({hash,title}) =>{ const Link = ({ hash, title }) => {
const handleLink = (event) => {
//manually change hash to trigger hashChange event.
window.location.hash = "#";
window.location.hash = hash;
};
const handleLink=(event)=>{ return (
//manually change hash to trigger hashChange event. <a onClick={handleLink} className="navlink">
window.location.hash = "#"; {title}
window.location.hash = hash; </a>
} );
};
return <a onClick={handleLink} className="navlink">{title}</a>
}
export default Link export default Link;