This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
createContext, | |
PropsWithChildren, | |
useContext, | |
useEffect, | |
useRef, | |
useState, | |
} from "react"; | |
// RESOURCES: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
// This example uses the Link component from 'react-router-dom' | |
// but can use any internal routing link component provided | |
// by a package (like Link from 'gatsby') | |
import { Link as RouterLink } from 'react-router-dom'; | |
const Link = ({ children, newTab, to }) => { | |
const isInternal = /^\/(?!\/)/.test(to); | |
const isFile = /\.[0-9a-z]+$/i.test(to); |