Failed prop type: Invalid prop `children` of type `array` supplied to `ForwardRef(ListItemIcon)`, expected a single ReactElement.
See original GitHub issueFailed prop type: Invalid prop children
of type array
supplied to ForwardRef(ListItemIcon)
, expected a single ReactElement.
<ListItem style={{“marginTop”:“-16px”,“marginBottom”: “-7px”}} button key={i+“i”} > <ListItemIcon key={i+ subOption.text+‘d’ } className={classes.menuPosition}><span key={ subOption.text+1+i+1 } className={subOption.icon}/> </ListItemIcon> <ListItemText style={{marginBottom:‘-5px’,marginTop:‘-8px’, padding:‘0px 16px’}} key={i+ subOption.text+‘e’} primary={ subOption.text } className=“menu-text-Color” /> </ListItem>
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Invalid prop `children` of type `array` supplied to `ForwardRef ...
Failed prop type : Invalid prop children of type array supplied to ForwardRef(ListItemIcon), expected a single ReactElement.
Read more >React error 'Failed propType: Invalid prop `children` supplied ...
According to the doc, you can just use a normal React element instead of a function inside <Provider /> . As a result,...
Read more >Warning: Failed prop type: Invalid prop `children` supplied to ...
Warning: Failed prop type: Invalid prop `children` supplied to `ForwardRef(Typography)`, expected a ReactNode. */<Typography key={item.id}>
Read more >invalid prop `rows` of type `object` supplied to `forwardref ...
Failed prop type: Invalid prop children of type array supplied to ForwardRef(ListItemIcon) , expected a single ReactElement. failed Proptypes.
Read more >2 Answers - OneCompiler
Getting Warning: Failed prop type: Invalid prop `children` supplied to `ForwardRef(Tooltip)`. Expected an element that can hold a ref.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
My code
<ListItemIcon> <HomeIcon className={classes.icon}/> </ListItemIcon>
showed the same error. When i remove the white space and moved to new line i was able to remove the errori just have the same error, wrapping all inside a fragment (</>) resolved: