question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

StyleProvider Context missed

See original GitHub issue

StyleProvider Context is missed and get all times the default options

<StylesProvider
        generateClassName={pageContext.generateClassName}
        jss={pageContext.jss}
        {...paramsToTheme}
        // registry={pageContext.sheetsRegistry}
        // jss={pageContext.jss}
        // generateClassName={pageContext.generateClassName}
      >
        <ThemeProvider
          // {...paramsToTheme}
          theme={pageContext.theme}
          // sheetsManager={pageContext.sheetsManager}
        >
          <CssBaseline />
          <ErrorBoundary location={location} history={history}>
            <AppWrapper {...this.props} changeTheme={this.changeTheme} />
          </ErrorBoundary>
        </ThemeProvider>
      </StylesProvider>

but the options pass to provider when makestyles get the context the context is other

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
joacubcommented, May 21, 2019

Yes the error is beco use the context is different so is becomes you have different vesions of material ui core and styles package , if you remove the dependencia of styles and only let the core it’s all right if not the core use a self version of styles and you are getting other version in your own code of style provider

1reaction
eps1loncommented, May 21, 2019

Your version strings in your package.json seem off. Please add a lockfile and verify that only a single version of @material-ui/styles is installed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

StyleProvider Context missed · Issue #15767 · mui/material-ui
StyleProvider Context is missed and get all times the default options. <StylesProvider generateClassName={pageContext.
Read more >
How to styling header & button with StyleProvider at the same ...
I want to change background color of header and add custom style property on the button. <Container> <Header /> /*change backgroundColor*/ < ...
Read more >
Advanced Usage - styled-components
This way themes themselves can be made contextual. ... This is useful to circumvent a missing ThemeProvider or to override it.
Read more >
5 React Material UI Features You Might Have Missed
As a frontend engineer, Material-UI is my favorite styling option for React Components. Its sleek design and elegance made it stand out from ......
Read more >
cf-style-provider - npm Package Health Analysis - Snyk
Looks like cf-style-provider is missing a security policy. ... To ensure that everything has the same context and works properly, you should never...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found