Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

315
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!