Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V1.0.10 remove withStyles #417

Closed

Conversation

twankeizer
Copy link

I don't know how you want to make notistack compatible with @material-ui V4 and V5 at the same time. This solution should work without changing a lot of things. To make notistack compatible with @material-ui V4 and V5 I refactored the code. These are the change I made:

  • add @material-ui/styles package to make either V4 or V5 compatible
  • replace withStyles import with import { createStyles, makeStyles } from '@material-ui/styles' in SnackbarContainer, SnackbarContent and SnackbarItem
  • refactor withStyles and classes to use createStyles, makeStyles
  • remove withStyles HOC and Typescript extension

I used npm run build to build the package and tested it inside our @material-ui V5 project and it works like before.

I'm using npm v7, so the package-lock.json is now lockfileVersion 2 and many changes have been made inside it. If you don't want this you can remove the package-lock.json and run npm install to generate a new one.

@msalahz
Copy link

msalahz commented Aug 16, 2021

What is the status of this?

@iamhosseindhv
Copy link
Owner

Thanks for your contribution @twankeizer . Even though this is a small PR and I would've loved to merge it, we don't want to force people to install @material-ui/styles as a dependency. Please have a look into #387 (comment). PR 418 is more close to what we're looking for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants