question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warning: Failed prop type: Invalid prop `centerElement` supplied to `ListItem`.

See original GitHub issue

I 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:open
  • Created 6 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
suv0commented, Nov 12, 2018

@MingweiSamuel – Pretty certain my code isn’t doing that.

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.

0reactions
andy-twostickscommented, Apr 13, 2018

@MingweiSamuel – Pretty certain my code isn’t doing that.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found