Code Monkey home page Code Monkey logo

Comments (4)

romgrk avatar romgrk commented on September 25, 2024

Please provide a minimal reproduction test case with the latest version. This would help a lot 👷.
A live example would be perfect. This codesandbox.io template may be a good starting point.

Also, don't forget to attach your environment info in the description above. You can get it by running npx @mui/envinfo in your CLI.
Thank you!

from mui-x.

Forzali avatar Forzali commented on September 25, 2024

Hello, first of all, I apologize for the delayed response. It might take me a bit of time to illustrate the situation you're describing with a codesandbox example, so I'll explain the exact situation first.

I don't always want to display the datagridpro component; I'm using conditional rendering. And if the datagridpro component isn't rendered, I'm encountering an error like this. Is there a way to resolve this? I don't want to display the datagridpro component all the time, only in certain situations.

If you'd like, I can provide an example to explain further. Thank you in advance for your assistance.

from mui-x.

Forzali avatar Forzali commented on September 25, 2024

Hello again, I'm providing an example related to codesandbox. In the example, when I change the value of dataGridShow to false, I encounter the error you see. After changing the value to "true," it works smoothly.

Codesandbox example: https://codesandbox.io/s/optimistic-dubinsky-wflf7s?file=/demo.tsx

from mui-x.

romgrk avatar romgrk commented on September 25, 2024

If the datagrid isn't mounted & initialized, then calling the apiRef methods is incorrect because it's not setup.

Fixed: https://codesandbox.io/s/nervous-maxwell-dps4zv

from mui-x.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.