Rename Link to InternalLink and change usage

This commit is contained in:
2020-10-26 17:25:59 +05:30
parent 4117131c12
commit c6ad5ff8e3
2 changed files with 4 additions and 4 deletions
@@ -1,6 +1,6 @@
import React from "react"; import React from "react";
const Link = ({ hash, title }) => { const InternalLink = ({ 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 = "#";
@@ -14,4 +14,4 @@ const Link = ({ hash, title }) => {
); );
}; };
export default Link; export default InternalLink;
+2 -2
View File
@@ -7,7 +7,7 @@ slug: /
import Admonition from "../components/Admonition" import Admonition from "../components/Admonition"
import Accordion from "../components/Accordion" import Accordion from "../components/Accordion"
import Link from "../components/Link" import InternalLink from "../components/InternalLink"
import MDN from "../components/MDNBadge" import MDN from "../components/MDNBadge"
:::note DOM interfaces :::note DOM interfaces
@@ -66,7 +66,7 @@ for (let p of paras) {
} }
``` ```
`querySelectorAll` is also available on <b>Element</b> and <b>DocumentFragment</b>, in the <Link title = "same way as querySelector" hash = "link-element-has-qs"/>. `querySelectorAll` is also available on <b>Element</b> and <b>DocumentFragment</b>, in the <InternalLink title = "same way as querySelector" hash = "link-element-has-qs"/>.
<MDN title="querySelectorAll" url="https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll" /> <MDN title="querySelectorAll" url="https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll" />