Comments (3)
The root cause is that FilledInputRoot does not forward ownerState to InputBase which causes an error from the InputBase.
Can't we use the shouldForwardProp
for this? Can you create a simplified stackblitz to showcase the issue?
from pigment-css.
I believe I am hitting something similar... I am building a new next.js react app using app router and React Server Components. I found this awesome library and all the MUI - nextjs stuff that is coming together. I'm taking a gamble that MUI v6 with pigment-css will be released about the same time that I need it for this project (end of year 2024).
To see an example, I have created an app here: https://codesandbox.io/p/devbox/lively-snowflake-jc79t8
In this app, I have my layout, page and applicationHeader component all setup as RSC with appropriate styles, etc. I then embed a userProfileDropdown SSR / client component that uses material-ui emotion theming. All of this seems to work fine, styles seem to be applied correctly in both RSC and client components. However, I'm hitting an error when trying to reference Material-UI theme values directly. For example, my menu component will often be displayed inside modals, therefore, we bump up the z-index on the menu component to display correctly once in a modal. To do this, we grab the theme.zindex.modal
value and add 10 to it.
I'm hitting a build error, because it is unable to find that value in my pigment-css theme. Is there a way to setup my application so that the pigment-css theme merges the material-ui theme, or can tell the build engine to ignore the material-ui theme variables?
The build error is:
TypeError: /project/workspace/src/components/menu.tsx: Cannot read properties of undefined (reading 'modal')
at /project/workspace/src/components/menu.tsx:12:28
at SxProcessor.processCss (/project/workspace/node_modules/@pigment-css/react/processors/sx.js:260:59)
at SxProcessor.build (/project/workspace/node_modules/@pigment-css/react/processors/sx.js:162:22)
at /project/workspace/node_modules/@wyw-in-js/transform/lib/plugins/collector.js:26:17
at /project/workspace/node_modules/@wyw-in-js/transform/lib/utils/getTagProcessor.js:384:5
at Array.forEach (<anonymous>)
at applyProcessors (/project/workspace/node_modules/@wyw-in-js/transform/lib/utils/getTagProcessor.js:375:10)
at /project/workspace/node_modules/@wyw-in-js/transform/lib/plugins/collector.js:25:42
at EventEmitter.perf (/project/workspace/node_modules/@wyw-in-js/transform/lib/utils/EventEmitter.js:45:20)
at collector (/project/workspace/node_modules/@wyw-in-js/transform/lib/plugins/collector.js:24:16)```
from pigment-css.
I'm hitting a build error, because it is unable to find that value in my pigment-css theme. Is there a way to setup my application so that the pigment-css theme merges the material-ui theme, or can tell the build engine to ignore the material-ui theme variables?
I resolved this by extending the MUI Theme - this is exactly what I was looking and it clicked in my head today what to do.
from pigment-css.
Related Issues (20)
- [docs] Fix transformation link in HOW_PIGMENT_CSS_WORKS.md
- Shadow dom support HOT 1
- withPigment causes tsconfig compiler path option to not work HOT 10
- `useTheme` returns undefined for theme values HOT 4
- It prompts that "Uncaught SyntaxError" when using Pigment css v0.0.17 and vite. HOT 5
- Bugs with incremental adoption alongside styled-components HOT 4
- Storybook Vite / AntD incompatibility HOT 1
- [docs] How to use MUI themeProvider with Pigment CSS HOT 6
- Type errors when interpolating into tagged template literal
- Cannot style next/link component HOT 2
- Type error is thrown when using shorthand alias in sx prop HOT 1
- [bug] `Stack`, `Grid`, `Container` aren't usable as base for additional components
- [nextjs] Cannot use `sx` prop on layout components
- sx style delay with Button HOT 1
- Next/font breaks with pigment CSS
- Component styles are overridden when rendered inside Next.js layout HOT 1
- Color mode is not respected when using theme arg in sx prop HOT 1
- [docs] variables and selector like [theme.breakpoints.down('md')], how to use in Pigment CSS ? HOT 2
- Importing next/link in `async` component produces error HOT 4
- V6 Using Paper overrides style of unrelated components HOT 4
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 pigment-css.