Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Drawable Runtime - More Info in Description
The AppCompat Theme Theme.AppCompat.Light.NoActionBar provides a default Drawable resource for AppCompatEditText. The resource is located in @drawable/abc_edit_text_material.xml https://chromium.googlesource.com/android_tools/+/7200281446186c7192cb02f54dc2b38e02d705e5/sdk/extras/android/support/v7/appcompat/res/drawable/abc_edit_text_material.xml A Runtime Error is triggered in a scenario with the following conditions: 1) Rendering a large number of TextInputs in the screen with a key prop 2) Triggering re-render with setInterval The scenario is also experienced with FlatList and ONLY using TextInput component. The following Runtime Error is triggered: NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources) It is caused from the following line from abc_edit_text_material.xml <item android:state_pressed="false" android:state_focused="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/> I posted a Minimal Reproducible Example at #17530 (comment) This commit simply changes RNTester to use a custom drawable resource for TextInput named @drawable/edit_text.
- Loading branch information