Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

173
Vistas
How To Disable Grid and its children in React js MUI

I Want to Disable Grid (MUI Component) (and its Children) in React js .

and also , I Want to know how to Disable any Container and it's items in React js! (No matter what kind of children it has)

ex:

 <Grid
       item
       disabled  //And any other options
       xs={12}
       md={6}
       spacing={1}
       style={{ padding: '5px' }}>
       <CmpDateTimePicker
         label="from"
         value={this.props.from_timestamp}
         onChange={(from_timestamp) => 
             this.props.OnFromPeriodChanged(from_timestamp)}
         dir={dir}
         intl={intl}
         preSelect={lastMonthDate}
         />
  </Grid>

Thanks for your Help! :)

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The disabled prop is not available on every MUI component, but instead you can conditionally render a component by using a simple if statement or ternary operator.

Since you give no context for the above code, I can't directly give you an example, but I can give examples for the two cases I spoke about above.

You can use an if statement like:

if(<conditional>){
 return <Grid>...</Grid>
}

return <div></div>

With this code your component will only render what is in the if statement when your conditional is true.

Another way is to use a ternary:

return (
 <div>
   {<conditional>?<Grid>
   ...
   </Grid>:""}
 </div>
)

You can use this inside of jsx to only conditionally render a certain component.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda