Code Monkey home page Code Monkey logo

Comments (3)

mnajdova avatar mnajdova commented on August 24, 2024

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.

jbogedahl-st avatar jbogedahl-st commented on August 24, 2024

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.

jbogedahl-st avatar jbogedahl-st commented on August 24, 2024

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.
image

from pigment-css.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.