Skip to content

App crashes if changing the data of FlatList with renderItem TextInput quickly #15801

@JenningsWu

Description

@JenningsWu

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

  1. react-native -v: 0.48.1
  2. node -v: 8.4.0
  3. npm -v: 5.3.0
  4. yarn --version:

Then, specify:

  • Target Platform: iOS
  • Development Operating System: macOS
  • Build tools: Xcode 9.0 beta (9M136h)

Steps to Reproduce

(Write your steps here:)

  1. Create a FlatList with renderItem = TextInput, and a Button to control the content of the FlatList
  2. Click the Button quickly ("quckly" means you need to click the button before previous render is finished)
  3. The app will crash.

Expected Behavior

The app shouldn't crash.
If the render item of FlatList is another component like Text, it won't crash.

Actual Behavior

The app crash with log

FlatListOfTextInput[16471:6155941] *** Assertion failure in -[RCTUIManager setIntrinsicContentSize:forView:]_block_invoke(), /Users/jinningwu/Github/FlatListOfTextInput/node_modules/react-native/React/Modules/RCTUIManager.m:389
2017-09-04 19:40:06.314030-0700 FlatListOfTextInput[16471:6155941] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not locate view with tag #4245'
*** First throw call stack:
(0x18a752fe0 0x1891b4538 0x18a752eb4 0x18b1eb7cc 0x100117da4 0x10068da50 0x10068da10 0x10069b2e8 0x100691634 0x10069d630 0x10069d39c 0x189813100 0x189812cac)
libc++abi.dylib: terminating with uncaught exception of type NSException

Reproducible Demo

Could use this repo JenningsWu/FlatListOfTextInput to reproduce it.

It is interesting that I failed to reproduce the crash with expo Snack.

To reproduce, just run this repo with react-native run-ios or build with Xcode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions