Skip to content

Instantly share code, notes, and snippets.

View ledbetterljoshua's full-sized avatar

joshua ledbetter ledbetterljoshua

View GitHub Profile
@ledbetterljoshua
ledbetterljoshua / conditional.tsx
Created August 16, 2023 15:58
react conditional component
import React from "react";
const Case = ({ children }) => children;
const Default = ({ children }) => children;
const Switch = ({ children }) => {
let matchChild = null;
let defaultCase = null;
React.Children.forEach(children, (child) => {

Keybase proof

I hereby claim:

  • I am ledbetterljoshua on github.
  • I am joshual (https://keybase.io/joshual) on keybase.
  • I have a public key whose fingerprint is FE4A 3634 539F 02E4 18A4 C209 D079 26ED 2975 23C0

To claim this, I am signing this object: