1/** @jsxImportSource https://esm.sh/react */
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request): Promise<Response> {
1/** @jsxImportSource https://esm.sh/react */
2import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
3import { blob } from "https://esm.town/v/std/blob?v=12";
5import { createHash } from "node:crypto";
6import base32Encode from "npm:base32-encode";
7import { renderToString } from "npm:react-dom/server";
8
9const { author, name } = extractValInfo(import.meta.url);
1/** @jsxImportSource https://esm.sh/react */
2import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
3import { blob } from "https://esm.town/v/std/blob?v=12";
4import { Buffer } from "node:buffer";
5import { createHash } from "node:crypto";
6import { renderToString } from "npm:react-dom/server";
7
8const { author, name } = extractValInfo(import.meta.url);
1/** @jsxImportSource npm:preact */
2import valTownBadge from "https://esm.town/v/jxnblk/valTownBadge";
3import wrapper from "https://esm.town/v/jxnblk/valTownBadgeMiddleware";
4import { render } from "npm:preact-render-to-string";
5
6function handler(req: Request): Promise<Response> {
1/** @jsxImportSource npm:react */
2import React from "npm:react";
3
4export default function CodeIcon(props: React.SVGProps<SVGSVGElement>) {
5 return (
6 <svg
1null
2
3Migrated from folder: _LEAVE_AS_IS/badge_LEAVE_AS_IS/codeIconReact
7Run an editor like so:
8```tsx
9/** @jsxImportSource https://esm.sh/react */
10import { renderToString } from "npm:react-dom/server";
11
12export default async function(req: Request): Promise<Response> {
1/** @jsxImportSource https://esm.sh/react */
2import { renderToString } from "npm:react-dom/server";
3
4import { blob } from "https://esm.town/v/std/blob?v=12";
1/** @jsxImportSource https://esm.sh/react */
2import { renderToString } from "npm:react-dom/server";
3
4const genSVG = (request: Request): string => {
84};
85
86export const reactExample = (request: Request) =>
87 new Response(
88 genSVG(request),
1/** @jsxImportSource https://esm.sh/react */
2import { Chess, Move, Square } from "npm:chess.js";
3import minify from "npm:css-simple-minifier";
4import { renderToString } from "npm:react-dom/server";
5
6class StaticChess {