cannot appear as a descendant of

前端 未结 11 523
执念已碎
执念已碎 2021-01-30 04:36

I\'m seeing this. It\'s not a mystery what it is complaining about:

Warning: validateDOMnesting(...): 
cannot appear as a descendant of

. See

11条回答
  •  深忆病人
    2021-01-30 05:29

    I got this warning by using Material UI components, then I test the component="div" as prop to the below code and everything became correct:

    import Grid from '@material-ui/core/Grid';
    import Typography from '@material-ui/core/Typography';
    
    
      
        Lorem Ipsum
      
    
    

    Actually, this warning happens because in the Material UI the default HTML tag of Grid component is div tag and the default Typography HTML tag is p tag, So now the warning happens,

    Warning: validateDOMnesting(...): 
    cannot appear as a descendant of

提交回复
热议问题