• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

185
Views
Material-ui (@Mui) Theming how does it work behind the scenes passing functions to theme?

under this link: https://mui.com/styles/advanced/#theme-nesting I found a guide to customize theming... I was just wondering about that code part:

 <ThemeProvider
          theme={(outerTheme) => ({
            ...outerTheme,
            border: "2px solid black"
          })}
        >

Where you basically pass a function callback to the theme property, that returns an object (with the old ...outertheme props passed to the function and getting destructured and extended..)

I was wondering how was that construct called again and how does it work behind the scenes? I think there was somethign similar in React called render props, where you pass a function to a component property that returns a JSX Expression, but that function gets passed some property from the parent component, that gets that function passed as a child and executes the function but passes additional parameters beforehand to the function as the render props. Is that right?

<Component someThing={property => (<p>This is some {property}</p>)} />

and in Component:

({someThing}) => (...create `property`, return (someThing(property)))
about 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error