Skip to content

Instantly share code, notes, and snippets.

View dannyhw's full-sized avatar
:shipit:

Daniel Williams dannyhw

:shipit:
View GitHub Profile
@dannyhw
dannyhw / MarkdownWebview.tsx
Last active July 4, 2024 13:16
react native markdown using webview
import { SafeAreaView, Platform } from 'react-native'
import WebView from "react-native-webview";
const markdown = `
- hello from markdown
- test
---
@dannyhw
dannyhw / steps.md
Last active June 2, 2025 21:42
Expo router setup in 2 minutes

Heres how I add React native Storybook to an expo router project in 2 minutes

npm create storybook

choose recommended and then native

npx expo@latest customize metro.config.js
@dannyhw
dannyhw / ReactCompilerPlugin.ts
Created May 29, 2025 15:35 — forked from sikanhe/ReactCompilerPlugin.ts
React Compiler plugin for ESBuild
import { readFileSync } from "node:fs"
import * as babel from "@babel/core"
import BabelPluginReactCompiler from "babel-plugin-react-compiler"
import type { Plugin } from "esbuild"
import QuickLRU from "quick-lru"
export function ReactCompilerEsbuildPlugin({
filter,
sourceMaps,
runtimeModulePath,
@dannyhw
dannyhw / main.ts
Created August 21, 2025 15:33
make EXPO_PUBLIC accessible to storybook
import { StorybookConfig } from "@storybook/react-native-web-vite";
import { InlineConfig, mergeConfig } from "vite";
const main: StorybookConfig = {
stories: ["../components/**/*.stories.@(js|jsx|ts|tsx)"],
addons: ["@storybook/addon-docs", "@chromatic-com/storybook"],
framework: {
name: "@storybook/react-native-web-vite",
@dannyhw
dannyhw / buildIndex.ts
Last active December 7, 2025 23:32
get react native list of stories with node
import { normalizeStories, loadMainConfig } from 'storybook/internal/common';
import { readFileSync } from 'node:fs';
import { sync as globSync } from 'glob';
import path from 'path';
import { CsfFile, loadCsf } from 'storybook/internal/csf-tools';
import { toId } from 'storybook/internal/csf';
import {
type StoryIndex,
type IndexedCSFFile,
type NormalizedStoriesSpecifier,