-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[XGrid] ViewPort doesn't update on table state change when using the useApiRef in React.StrictMode #849
Comments
@MTPrescience Thanks for reporting the issue. This issue happens because we aren't yet able to work with strict mode enabled. Material-UI v4 is not really compatible with it (partially). This should be possible once we upgrade to Material-UI v5. You might have reported the same issue that we have ignored ( Out of curiosity what's your use case for using the apiRef? @dtassone Did you try to leverage? storybookjs/storybook#12734 We can't enable strict mode in the documentation until v5 because it breaks some of the styles but maybe it works in Storybook with v4. A side note. The codesandbox is a good reminder that we should treat modules in Material-UI as a global namespace. We need to prefix the exported data grid modules with Grid. import { XGrid } from "@material-ui/x-grid";
import { Grid } from "@material-ui/core"; |
@oliviertassinari - Thanks for your reply. Let's put that information together with the little information about the apiRef on your website then. Most people are not reading your tests before deciding on using a component ;-) I have several use cases atm.
|
I had a quick look and it works if you don't use the apiRef prop, I will investigate further |
Current Behavior 😯
When using the useApiRef in React strictMode - the XGrid stops re-rendering view - but table state updates.
The re-render can then be triggered by resizing the window.
Expected Behavior 🤔
Grid should keep current functionality and provide extra flexibility through the api.
Steps to Reproduce 🕹
https://codesandbox.io/s/sad-tu-tn5zs
Steps:
Context 🔦
Your Environment 🌎
`npx @material-ui/envinfo`
The text was updated successfully, but these errors were encountered: