You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Congratulations on the newest release! I'm really pumped to see createStyleContext!
I've noticed that withProvider and withContext automatically wraps passed component with panda factory, which is not always expected.
Problem Statement/Justification
There are two cases where it's problematic:
Props names clash
// dummy example to serve the point - `display` property is also available on `StyledComponent` produced by the factoryconstMyCardBody: React.FC<{display?: boolean}&React.PropsWithChildren>=({ display, children })=>{if(!display)returnnullreturn<div>{children}</div>}constBody=withContext(MyCard,'body')exportconstCard={ Body }// somewhere in the appconstApp=()=>{return(<Card.Bodydisplay>/* error: Type 'true' is not assignable to type 'ConditionalValue<AnyString | `var(--${string})` | Display | readonly string[] | undefined>' */test</Card.Body>)}
Opening the API to change styles of the component
This depends on the requirements, but I know there are a lot of cases where styling API should be explicitly disabled.
This discussion was converted from issue #3340 on August 27, 2025 20:32.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Congratulations on the newest release! I'm really pumped to see
createStyleContext
!I've noticed that
withProvider
andwithContext
automatically wraps passed component with panda factory, which is not always expected.Problem Statement/Justification
There are two cases where it's problematic:
This depends on the requirements, but I know there are a lot of cases where styling API should be explicitly disabled.
Proposed Solution or API
Maybe:
createStyleContext
APIAlternatives
No response
Additional Information
https://play.panda-css.com/NjrQnToicx
Beta Was this translation helpful? Give feedback.
All reactions