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
Uh oh!
There was an error while loading. Please reload this page.
-
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.tsxyou needtype ElementType = JSX.ElementTypeinstead of gettingElementTypefrom'react'lib/create-style-context.tsxTypeScript needs some help with thecreateElementoverloads called inwithContext. Tryif (typeof Component === 'string') { return... } else { same return }node_modules/preact-iso/src/router.d.tsthe preact-iso router redefines JSX intrinsics in thepreactmodule, including adefault?: booleanproperty 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.tspreact definesHTMLAttributes.sizetoo strictly for thesizeparameter to pass type checking onHeading, likely other components too. Loosen that somehow, I just addedstringandSignalLike<string | undefined>to thesizeunion type.Beta Was this translation helpful? Give feedback.
All reactions