React library using default MUI theme instead of custom theme injected in parent react app

Viewed 72

Current Behavior

I have a React library which uses mui theme(custom). It is used in a react app which injects the theme using theme provider but the library is using the default MUI Theme instead of the custom theme.

Expected Behavior

It should use the custom theme provided in the react app instead of the mui default theme.

Steps to Reproduce

Steps:

  1. Create a library which uses custom theme.
  2. Inject the theme in your react app.
  3. Check if it is using the same theme.

Context

Trying to build a library which inherits the theme from the parent react app.

My Environment

 npx: installed 2 in 9.464s

  System:
    OS: Windows 10 10.0.19043
  Binaries:
    Node: 14.17.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.14.13 - C:\Program Files\nodejs\npm.CMD
  Browser:
    Edge: Spartan (44.19041.1023.0), Chromium (92.0.902.84)
0 Answers
Related