Comments (18)
@kubalobo We used to pass variant=subtitle1
to bypass the warnings regarding internal use of a deprecated variant by material-ui SnackbarContent.
But this will be removed in the next release of notistack, since we can mute the warnings using useNextVariants
in theme (see migration notes).
from notistack.
Yes I did and it confirmed that notistack is the issue. Ok I will try to reproduce that and post it here.
from notistack.
Provide codesandbox @pedro-dcc
Sorry for coming back so late. I was wrong. I have faced this issue only because I had the snackbar provider outside MuiTheme. After put that inside the warning has gone. Thanks.
from notistack.
Propably something quite similar here:
from notistack.
@JakubPetriska notistack doesn't use any Typography
component; however, material-ui SnackbarContent
uses it internally.
Your issue should be fixed by migrating to Typography v2
api. Read the migration note here.
from notistack.
@iamhosseindhv I actually am using the new Typography variants.
from notistack.
Have you tried isolating / commenting out notistack to make sure the warning is comming from notistack? @JakubPetriska
If you think it's a notistack issue, please reproduce the warning and provide a link to codesandbox.
from notistack.
@iamhosseindhv The error can be seen in this codesandbox. It's the minimal notistack
usage example from here but I updated the material-ui
dependency to version 3.2.2. The same thing happens for material-ui
3.4.0.
from notistack.
@JakubPetriska Downloaded the sandbox and I don't get any warning.
Run npm ls @material-ui/core -g
and check if you have the same version of material-ui installed. (note the -g
flag)
I'll have an eye on this issue in case more people complained about it.
from notistack.
The error happens in the sandbox. I didn't try to download it. Why is there a -g
flag?
from notistack.
To compare material/notistack versions installed under /usr/local/lib
and your working directory.
According to docs, "List packages in the global install prefix instead of in the current project." So I was wondering maybe you have different versions of material/notistack installed globally and your working directory.
What I just said might be irrelevant to the problem though.
from notistack.
I don't have either installed globally, which the output of the command you sent confirmed.
from notistack.
This happens to me too and is notistack for sure... Any news on how to fix?
React 16.7.0-alpha.0
MUI 3.3.2
notistack 0.3.7
Since this will be fixed on 0.3.8 when this version will be published?
from notistack.
@pedro-dcc You should not get any warning regarding "Deprecated variants" using current version of notistack, if you have done material-ui migration instructions.
@JakubPetriska The reason minimal example gives us deprecation warnings is that we don't use theme
in it. so we can't set Typography.useNextVariant
to true. However, I've added the following loc to the minimal example to avoid getting those nasty warnings:
https://github.com/iamhosseindhv/notistack/blob/master/demo/MessageButtons.js#L47
// Avoid material-ui warnings. more info: https://material-ui.com/style/typography/#migration-to-typography-v2
window.__MUI_USE_NEXT_TYPOGRAPHY_VARIANTS__ = true;
from notistack.
@iamhosseindhv you are wrong. I'm already setting "useNextVariants" to true and the warning still happened. And shows up when I show some notistack snackbar.
Also, with release from today i get another warning
from notistack.
Provide codesandbox @pedro-dcc
from notistack.
The warning being discussed here no longer appears. I upgraded dependencies in the codepen I provided, the changes can be seen here, and it no longer appears in there either. Unless somebody objects I guess we can close this @iamhosseindhv .
from notistack.
Thanks for the update @JakubPetriska
from notistack.
Related Issues (20)
- NextJs server component support - enqueueSnackbar is not a function (missing "use client" directive) HOT 1
- Feature Request
- Can we use the existing snackbar to use the notistack
- Styles not applied when rendering in custom element with shadow dom HOT 2
- domRoot is ineffective HOT 2
- [help] How can I make new snackbar always appears at the start position instead of at the rear? HOT 2
- Document has multiple elements referenced with ARIA with the same id attribute: notistack-snackbar
- autoHideDuration values not respected in Chrome 116.0.5845.179 HOT 3
- Feature request: option to bypass `maxSnack` HOT 2
- Question is it possible to identify if there is snack on the screen
- JS Example for Custom Notistack HOT 1
- Feature request: compiled react / pure JS documentation
- How to trigger "close Snack bar" from custom snack bar component. HOT 3
- Update clsx version
- snackbar id value appears on the screen
- Impossible to tell if user intentionally closed a notification
- Type issue when extending SnackbarProvider Components with custom component HOT 6
- The global settings on the provider doesn't work HOT 4
- [Documentation] Update custom snackbar component example HOT 2
- Incorrectly generated styles only in production build
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from notistack.