ListItem typescript error with 2.3.0
See original GitHub issueExplain what you did (Required)
Tried to follow the upgrade guide for 2.3.0. Im upgrading from 2.1.0.
Changed my old code:
<ListItem
title="Edit message"
leftIcon={{ name: 'edit' }}
onPress={() => {
setMenu(false)
setEditing(true)
}}
/>
to:
<ListItem
onPress={() => {
setMenu(false)
setEditing(true)
}}
>
<ListItem.Content>
<Icon name="edit" />
<ListItem.Title>Edit message</ListItem.Title>
</ListItem.Content>
</ListItem>
Expected behavior (Required)
Successful typescript compile.
Describe the bug (Required)
Got a typescript error:
Property 'Content' does not exist on type 'typeof ListItem'. TS2339
214 | <ListItem.Content>
| ^
I also get the same error for ListItem.Title
:
Property 'Title' does not exist on type 'typeof ListItem'. TS2339
To Reproduce (Required)
We highly recommend that you re-create the bug on Snack. If not, list the steps that a reviewer can take to reproduce the behaviour:
Screenshots (Required)
Your Environment (Required):
software | version |
---|---|
react-native-elements | 2.3.0 |
react-native | 0.63.2 |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:8 (5 by maintainers)
Top Results From Across the Web
error in typescript for each loop syntax - Stack Overflow
it's just a linting error, it's telling you to use const instead of let in that for because you are never reassining prop...
Read more >Upgrading to 15.5.x causes TS2559 errors to appear in ...
After upgrading from 15.4.x to 15.5.x, a large number of TS2559 errors appear in the Error List window and offending types are underlined...
Read more >Write efficient, error-free and safe regular expressions in ...
Hello JavaScript and TypeScript developers, We just released a set of rules to help you write efficient, error-free, and safe regular ...
Read more >knex - npm
Latest version: 2.3.0, last published: 4 months ago. ... TypeScript icon, indicating that this package has built-in type declarations. 2.3.0 ...
Read more >Swagger Codegen Documentation
2.3.0 (upcoming minor release), TBD, 1.0, 1.1, 1.2, 2.0, Minor releases with breaking ... To get a list of languages supported by the...
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
@flyingcircle If the
Raw Text
lint rule was some random obscure rule I’d 100% remove it, but its not. I can’t be the only person with this rule on and passing text into theListItem.Text
component. The React Native Elements core hasn’t shut it off. Thanks for the quick response 👋I know this is closed but I’m still seeing this issue for
ListItem.Title
&ListItem.Subtitle
for passing raw text. My components work and the text is visible, but the lint warning is gross. Any suggestions?