Experimenting with Preact + PandaCSS + Park-UI #273
Closed
mstephenson6
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've got a hello world page going with Preact + PandaCSS + Park-UI very basic components:
Card.*
,Heading
,HStack
,Text
,VStack
. It took some hacks to get off the ground, I'm leaving a list here for anyone else attempting a Preact build.PandaCSS + Park-UI work really well with Preact's dead simple SSR so far. I'm feeling motivated to turn the hacks into real solutions and make a real Preact starter down the road.
lib/create-style-context.tsx
you needtype ElementType = JSX.ElementType
instead of gettingElementType
from'react'
lib/create-style-context.tsx
TypeScript needs some help with thecreateElement
overloads called inwithContext
. Tryif (typeof Component === 'string') { return... } else { same return }
node_modules/preact-iso/src/router.d.ts
the preact-iso router redefines JSX intrinsics in thepreact
module, including adefault?: boolean
property that seems to break lots of park-ui component JSX. Comment out the declarations at the end of this file.node_modules/preact/src/jsx.d.ts
preact definesHTMLAttributes.size
too strictly for thesize
parameter to pass type checking onHeading
, likely other components too. Loosen that somehow, I just addedstring
andSignalLike<string | undefined>
to thesize
union type.Beta Was this translation helpful? Give feedback.
All reactions