Home > Mobile >  Cannot redeclare block-scoped variable 'HermesInternal'
Cannot redeclare block-scoped variable 'HermesInternal'

Time:02-26

So I am using FlatList in react native, however, I cannot display the data out with flatlist, and the node module turns out to have this error.

FlatList usage:

 <FlatList
      style={{ height: "100%" }}
      data={matches}
      keyExtractor={(item) => item.id}
      renderItem={(item) => <ChatRow matchDetails={item} />}
    />

Index.d.ts in Node Module

 const originalXMLHttpRequest: any;

    const __BUNDLE_START_TIME__: number;
    const ErrorUtils: ErrorUtils;

It has these errors:

Cannot redeclare block-scoped variable 'originalXMLHttpRequest'.
Cannot redeclare block-scoped variable '__BUNDLE_START_TIME__'.
Cannot redeclare block-scoped variable 'ErrorUtils'.
Cannot redeclare block-scoped variable '__DEV__'.
Cannot redeclare block-scoped variable 'HermesInternal'.

CodePudding user response:

Check renderItem({ item, index, separators })

So replace your renderItem by this renderItem={({item}) => <ChatRow matchDetails={item} />}

  • Related