Skip to content

Instantly share code, notes, and snippets.

View zackdotcomputer's full-sized avatar
🔨
Building

Zack Sheppard zackdotcomputer

🔨
Building
View GitHub Profile
@zackdotcomputer
zackdotcomputer / LinkTo.tsx
Last active August 27, 2022 15:43
Workaround for next/link vs <a> href accessibility lint issue
// Created by Zack Sheppard (@zackdotcomputer) on 1/19/2021
// Freely available under MIT License
// Workaround for https://github.com/vercel/next.js/issues/5533
import Link, { LinkProps } from "next/link";
import { AnchorHTMLAttributes, PropsWithChildren } from "react";
type PropTypes = LinkProps & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href">;
/// A unified component for the next/link <Link> and a standard <a> anchor.
@zackdotcomputer
zackdotcomputer / FirebaseAuth.tsx
Created February 27, 2021 18:19
Next.js compatible Firebase Auth Button
/**
* This is a rewrite of the firebase/firebaseui-web-react auth button
* so that it supports Next.js's requirement that no css be imported
* in the node_modules directory. Instead, you should use this component
* and make sure that you add this import to your page file:
* > import "<path to>/node_modules/firebaseui/dist/firebaseui.css";
*
* This rewrite was done by Zack Sheppard (@zackdotcomputer) in Feb 2021.
* It is relicensed under Google's Apache 2 License below.
*/
@zackdotcomputer
zackdotcomputer / App.tsx
Created March 21, 2022 12:55
Fix Clerk Unmount on Reauth
import { AuthProvider, useAuth } from "@redwoodjs/auth";
import { ClerkProvider, useClerk, useUser as useClerkUser } from "@clerk/clerk-react";
import { FatalErrorBoundary, RedwoodProvider } from "@redwoodjs/web";
import { RedwoodApolloProvider } from "@redwoodjs/web/apollo";
import FatalErrorPage from "src/pages/FatalErrorPage";
import Routes from "src/Routes";
import "./index.css";
import { navigate } from "@redwoodjs/router";