-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: StrictMode compliance is important for Async Rendering and other Future Tech(tm). Also clean up some lint. == Test Plan == * No more StrictMode warnings for `FlatList` (`VirtualizedList` is another story....). * props warnings still show up when appropriate. Reviewed By: sophiebits Differential Revision: D8026333 fbshipit-source-id: e6fa2f02d546b883df6f3cff8776c26c6ef91bc9
- Loading branch information
1 parent
26a1eba
commit a90d0e3
Showing
2 changed files
with
44 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hi @sahrens,
In some scenarios
this.props
isundefined
even ifprops
has a value.I faced that problem running a test in a component that uses FlatList.
The error was this one:
● CustomSideMenu component › CustomSideMenu empty snapshot test › should render correctly TypeError: Cannot read property 'getItem' of undefined at FlatList._checkProps (node_modules/react-native/Libraries/Lists/FlatList.js:519:7) at new FlatList (node_modules/react-native/Libraries/Lists/FlatList.js:464:10)
The way I solved was assigning
this.props = props
before thethis._checkProps(this.props)
, but I can not do that in the React Native library.I am using
react: 16.9.0
andreact-native: 0.61.4
.Do you know why am I getting this problem here?
Thanks in advance,
Carmo