Warning: Failed prop type: Invalid prop `centerElement` supplied to `ListItem`.
See original GitHub issueI get the above warning from the following JSX:
render() {
return (
<Card>
<ListItem
leftElement={this.avatar()}
centerElement={{
primaryText: this.props.title,
secondaryText: this.props.subtitle, }}
/>
<View style={{paddingHorizontal: 16, paddingBottom: 16}}>
<Text>{this.props.text}</Text>
</View>
</Card>
);
}
The center element renders correctly, despite the warning message.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
Invalid prop `style` of type `array` supplied to `IconToggle ...
I get a error for the below code. <ListItem divider leftElement="audiotrack" centerElement={{ primaryText: 'Diffused Reflection', secondaryText: ...
Read more >Failed prop type: Invalid prop `lg` supplied to `ForwardRef(Grid)`
Warning : Failed prop type: Invalid prop lg supplied to ForwardRef(Grid), expected one of type [number, boolean]. The Grid component expects ...
Read more >Failed prop type: Invalid prop `description` supplied to `ListItem`
Failed prop type : Invalid prop `description` supplied to `ListItem`. Relates to 1. Relates to 1 issue (0 unresolved).
Read more >failed prop type: invalid prop `rows` of type `object` supplied to ...
warning : failed prop type: invalid prop `rows` of type `object` supplied to `forwardref(datagrid)`, expected `array`. Clear input field icon. Search query.
Read more >Warning: Failed prop type: Invalid prop `children` supplied to ...
Warning : Failed prop type: Invalid prop `children` supplied to `ForwardRef(…)`, expected a ReactNode. Material UI⁴.11, React¹⁷.0.2, Created at ...
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 FreeTop 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
Top GitHub Comments
Any update on your side ?
So, I was getting same warning for long time even though my code render the view properly
centerElement={{ primaryText: item.name, secondaryText: item.price }}
Then after a while I find out that
item.price
is a number type, not a string - that is what causing the warning.@MingweiSamuel – Pretty certain my code isn’t doing that.