From 890fac1afc561088a3fa651981b9493db9773fc1 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Fri, 26 Dec 2025 22:05:23 -0800 Subject: [PATCH] fun --- examples/index.tsx | 11 ++++++----- src/index.tsx | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/index.tsx b/examples/index.tsx index eaf35dc..73f3f11 100644 --- a/examples/index.tsx +++ b/examples/index.tsx @@ -1,5 +1,4 @@ import { define } from '../src' - import { Layout } from './helpers' const P = define('P', { @@ -46,10 +45,12 @@ const ExampleCard = define('ExampleCard', { }, render({ props: { title, desc }, parts: { Root, H2, P } }) { - return -

{title}

-

{desc}

-
+ return ( + +

{title}

+

{desc}

+
+ ) } }) diff --git a/src/index.tsx b/src/index.tsx index a4778c5..9b39377 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -161,6 +161,7 @@ export function define(nameOrDef: string | TagDef, defIfNamed?: TagDef) { const name = defIfNamed ? (nameOrDef as string) : `Def${anonComponents++}` const def = defIfNamed ?? nameOrDef as TagDef + if (styles[name]) throw `${name} is already defined! Must use unique names.` registerStyles(name, def) return (props: Record) => {