Moving to more workable v1 solution

This commit is contained in:
Max Lynch
2021-01-09 10:52:20 -06:00
parent 6a14c1c47a
commit ba42e4d6d8
22 changed files with 288 additions and 291 deletions
+24
View File
@@ -0,0 +1,24 @@
import { useEffect, useState } from 'react';
import { Link as ReactRouterLink } from 'react-router-dom';
const Link = ({ children, href, router, ...props }) => {
const [local, setLocal] = useState(false);
useEffect(() => {
setLocal(true);
}, []);
console.log('Rendering link', local, router);
if (!local || router === false) {
return children;
}
// return <a {...props}>{children}</a>;
return (
<ReactRouterLink to={href} {...props}>
{children}
</ReactRouterLink>
);
};
export default Link;