Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

174
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda