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

317
Visualizações
React does not recognize the `justifyContent` prop on a DOM element
const useStyles = makeStyles((theme) => ({
root:{
    padding: 0,
    textAlign: 'left',
    flexDirection: '100vh',
},
}));
    

return (
    <Container>
    <div className={classes.root}>
    <Grid container spacing={2} className={classes.Grid} justifyContent="center">
        <Grid item xs={12}>
            <RadioGroup row  aria-label="type" name="name"  className={classes.weightradio} defaultValue={"1"} value={weightRadio} onChange={handleWeightRadio}> 
                <FormControlLabel value="1"  control={<Radio />} label="1kg" />
                <FormControlLabel value="2"  control={<Radio />} label="2kg" />
                <FormControlLabel value="others"  control={<Radio />} label=">3kg" />
            </RadioGroup>
        </Grid>
        .....
   </Gid>

log show me---

index.js:1 Warning: React does not recognize the justifyContent prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase justifycontent instead. If you accidentally passed it from a parent component, remove it from the DOM element.

I have checked the doc of MUI 4.0, justifyContent is supported, where is the problem.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Ok I got the answer.

justify instead of justifyContent , and should not set to Grid root , correct code as below ,

        <Grid container spacing={2} className={classes.Grid}>
        <Grid item xs={12} container justify="center">   //changed here 
            <RadioGroup row  aria-label="type" name="name"  className={classes.weightradio} defaultValue={"1"} value={weightRadio} onChange={handleWeightRadio}> 
                <FormControlLabel value="1"  control={<Radio />} label="1kg" />
                <FormControlLabel value="2"  control={<Radio />} label="2kg" />
                <FormControlLabel value="others"  control={<Radio />} label=">3kg" />
            </RadioGroup>
        </Grid>
about 4 years ago · Juan Pablo Isaza Relatório

0

There is a difference in versions. Not all 4.* versions support justifyContent Probably versions earlier than 4.12 operate only justify: https://github.com/mui-org/material-ui/pull/21845

For 4.11.4 this is definitely the case

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