-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[Tabs] Warning: Material-UI: the value provided 0
is invalid when using dynamic data
#8489
Comments
Same error in using material-ui: v1.0.0-beta.34 |
Likewise. Seeing this in beta.34 |
@oliviertassinari turns out mine was a bug on my end. My application was momentarily redirecting to different URL, which resulted in the wrong value being applied to the state for a moment, resulting in this error being displayed. I've fixed it now. Thanks! |
@goodbomb I have same problem when app momentarily redirects to another page. Thus error from material tabs occurs. How did you fix that. Did you use some sort of default value? |
@Daniela0106 Do you have a reproduction example? A codesandbox would be perfect :) |
Thanks @oliviertassinari :) 👍 Here: https://codesandbox.io/s/7wq99vxrkx (the other was the embeded one) |
So, turns out it was just const value = '/theatre'; had some unnecessary brackets around it... So, my bad @oliviertassinari :) 👍 No more error logs |
@Daniela0106 Great :) |
I'm having this issue - doesn't break the code, but the component doesn't seem very psyched to see a custom value |
@SleighJ Do you have a reproduction? |
Actually this happen when I don't provide a parameter event value for onChange function.
|
I have a same problem, and fix this set the state of component with initializing 0: const [value, setValue] = useState<number>(0); |
Is there a recommended way to display tabs conditionally without receiving the
There's also a flicker on the |
@JavaJamie Do you have a reproduction for this using the latest version? The way the warning is currently isn't ideal but it's very often reliable. |
@oliviertassinari try this: https://codesandbox.io/s/material-ui-match-g2x5c?file=/src/App.js
This is as minimal as it gets, but we have various tabs views that are shown at different breakpoints and these flickers make it look very janky. |
@JavaJamie Oh ok, then the tab warning is correct. Regarding the flickering, feel free to work on the issue: #21142. We simply need to swap useEffect with useLayoutEffect when possible. |
version: 1.0.0-beta.11
When I am using a static data to render Tabs, it works fine,
but if the data was fetched from a remote server, I got this warning
besides, the selected tab was not behaved correctly:
the text was colored but there is no active indicator below the text.
here is my code
The text was updated successfully, but these errors were encountered: