Comments (4)
If this is closed source, I'd like to see the Gatsby config and Babel and TypeScript configs.
It seems that the issue is somewhere around JSX runtime configuration, so the config files might lead us towards the cause.
from theme-ui.
Thank you for the issue!
What framework are you using? And what version of Theme UI do you have?
What I mean by it, this is weird and not intended. Both the tests here and all my apps using Theme UI would entirely break if this happened to me, so let's try to figure out why it happens, what kind of setup do you have.
from theme-ui.
Hi, and thanks for the prompt reply!
We’re using theme-ui 0.15.5, and the bug is exhibited both in a couple of applications that consume these components; one is a Gatsby application, and the other is a craco app.
The components we build using Theme UI are part of a design system monorepo which are published as private npm packages (containing CJS/ESM), then consumed by various internal applications (mostly some variety of create react app), as well as the two main apps I mentioned above (one is used as our internal documentation site, the other is essentially for visual regression testing). To try and streamline the experience for internal developers, we publish our own theme package which wraps most of the theme-ui dependencies, along with providing our theme defaults.
Does that answer your questions, or are there any other specifics that would be helpful?
from theme-ui.
I have the same problem with NextJs 14.
In fact I have to change the name to ssx
in order to be ok with Theme UI style system, so like
<Comp ssx={{ mt: 30 }} />
export default function Comp({ children, ssx }: Props) {
return <div sx={ssx}>{children}</div>
}
I'm using the tsconfig in order to avoid putting the pragma at every .tsx file
The reason is probably here. It just check if key === 'sx'
, and skips it. It should check if it's a React component, and not a primitive one (like h1
, h2
, div
, etc.). I should be able to call a prop sx
in a React component.
// theme-ui/packages/core/src/parseProps.tsx
export function parseProps(props: any) {
if (!props || (!props.sx && !props.css)) return props
const next: Record<string, unknown> = {}
for (let key in props) {
if (key === 'sx') continue
next[key] = props[key]
}
next.css = getCSS(props)
return next
}
from theme-ui.
Related Issues (20)
- Different fonts for each URL
- Flex sx prop don't take a function HOT 7
- Update "How it Works" Guide HOT 1
- @theme-ui/prism README improvements
- Declaration file parsing error HOT 4
- @theme-ui/global breaks when using with Vite.js define global config HOT 1
- supports the theme on `clamp` HOT 3
- link component breaks with nextjs link v13 HOT 3
- Vite crush when use theme-ui with vite-plugin-linter
- button colors for dark mode not working theme ui HOT 3
- Module '"theme-ui"' has no exported member 'Grid'.ts(2305) HOT 1
- Give logo image a white BG on README HOT 2
- Unable to use sx prop on Input component HOT 2
- NextJS: 'Box' cannot be used as a JSX component. HOT 5
- TS error: Namespace 'React.JSX' has no exported member 'ElementType'. HOT 4
- useBorderBox: false not working HOT 1
- Several TypeScript errors when upgrading to 0.16.1 HOT 5
- After updating the fonts are not properly resolved HOT 1
- Media queries are overwritten HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from theme-ui.