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.

ListItem: Typescript error with @types/react-native >= 0.65.7

See original GitHub issue

Explain what you did (Required)

Upgraded @types/react-native to version 0.65.8

Expected behavior (Required)

No type errors happen

Describe the bug (Required)

I am now getting this typescript error:

error TS2739: Type '{ children: Element[]; bottomDivider: boolean; disabled: boolean | undefined; onPress: (() => void) 
| undefined; }' is missing the following properties from type 'Pick<TouchableHighlightProps & { containerStyle?: 
StyleProp<ViewStyle>; disabledStyle?: StyleProp<ViewStyle>; ... 6 more ...; children?: any; } & Partial<...>, 
"children" | ... 45 more ... | "bottomDivider">': hasTVPreferredFocus, tvParallaxProperties

20     <ListItem
        ~~~~~~~~

This is probably caused by the change in this PR: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/56374 (worked with 0.65.6, error appeared with 0.65.7).

To Reproduce (Required)

Just use a simple <ListItem> in a RN project with Typescript.

Screenshots (Required)

Not required here

Your Environment (Required):

software version
react-native-elements 3.4.2
react-native 0.66.1
@types/react-native 0.65.8

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:17
  • Comments:14

github_iconTop GitHub Comments

9reactions
foushcommented, Oct 28, 2021

It looks like the DefinitelyTyped fix is merged, can we cut a new release to incorporate the change so our typescript doesn’t make us add a bunch of

      hasTVPreferredFocus={undefined}
      tvParallaxProperties={undefined}

everywhere?

8reactions
flyingcirclecommented, Dec 13, 2021

@renchap I’m still putting out fires at work due to this log4j thing. But I’ll see if I can do a quick release sometime this week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Typescript prop error in ListItem (Material UI component)
I'm having an issue with the ContainerComponent and ContainerProps, i think the problem is that "li" is of type string, ...
Read more >
TypeScript errors and how to fix them
Below you find a list of common TypeScript errors along with the buggy code and its fixed version. If you're interested in more...
Read more >
ListItem: Typescript error with @types/react-native >= 0.65.7
Just use a simple <ListItem> in a RN project with Typescript. Screenshots (Required). Not required here. Your Environment (Required):. software, version ...
Read more >
ListItem: Typescript error with @types/react-native >= 0.65.7
Just use a simple <ListItem> in a RN project with Typescript. Screenshots (Required). Not required here. Your Environment (Required):. software, version ...
Read more >
TypeScript: is it possible to see errors not in one line?
To modify error messages, you either need to configure or improve the ... the Quickfix API ( :help quickfix-functions ) to modify the...
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