I'm building a reusable shared-component library using material-ui which is being imported in my main app like this:
import { theme, StepperComponent } from '@company/shared-components';
import { ThemeProvider } from '@mui/material/styles';
...
return (
<ThemeProvider theme={theme}>
<StepperComponent steps={stepperTitles} />
...
)
The stepper component is in my shared-components repository which I'm npm-linking
import React from 'react';
import Step from '@mui/material/Step';
import StepLabel from '@mui/material/StepLabel';
import { StyledStepper, StyledStepConnector, StyledStepIcon } from './Stepper.styles';
const StepperComponent = ({ steps, ...props }) => {
return (
<StyledStepper {...props} connector={<StyledStepConnector />} alternativeLabel>
However, for some reason the theme isn't getting applied to this component even though I'm wrapping it in the theme provider. When I log out the theme it doesn't include the colors that are in the theme being imported to my main app.
Does anyone know why this might be happening?