mirror of
https://github.com/bendtherules/UiQuestions.git
synced 2026-08-18 13:52:50 +00:00
Link - reformat
This commit is contained in:
+9
-7
@@ -1,15 +1,17 @@
|
|||||||
import React from "react"
|
import React from "react";
|
||||||
|
|
||||||
const Link = ({ hash, title }) => {
|
const Link = ({ hash, title }) => {
|
||||||
|
|
||||||
const handleLink = (event) => {
|
const handleLink = (event) => {
|
||||||
//manually change hash to trigger hashChange event.
|
//manually change hash to trigger hashChange event.
|
||||||
window.location.hash = "#";
|
window.location.hash = "#";
|
||||||
window.location.hash = hash;
|
window.location.hash = hash;
|
||||||
}
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<a onClick={handleLink} className="navlink">
|
||||||
|
{title}
|
||||||
|
</a>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
return <a onClick={handleLink} className="navlink">{title}</a>
|
export default Link;
|
||||||
}
|
|
||||||
|
|
||||||
export default Link
|
|
||||||
|
|||||||
Reference in New Issue
Block a user