WARN Looks like you're passing an inline function for 'component' prop for the screen 'Home' (e.g. component={() => <SomeComponent />}). Passing an inline function will cause the component state to be lost on re-render and cause perf issues since it's re-created every render. You can pass the function as children to 'Screen' instead to achieve the desired behaviour. #8517
Labels
I'm doing a Dynamic Drawer Navigator with React Navigation 5, and this warning appears:
WARN Looks like you're passing an inline function for 'component' prop for the screen 'Home' (e.g. component={() => }). Passing an inline function will cause the component state to be lost on re-render and cause perf issues since it's re-created every render. You can pass the function as children to 'Screen' instead to achieve the desired behaviour.
The problem is when I try to map() my Screens in the Drawer.Screen.
I tried a lot of things, but doesn't work, my Route Stack Itens:
Then my Screens:
Someone can help me ?
System:
OS: Windows 10 10.0.18363
CPU: (8) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
Memory: 8.37 GB / 15.94 GB
Binaries:
Node: 10.18.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.19.2 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.13.4 - C:\Program Files\nodejs\npm.CMD
SDKs:
Android SDK:
API Levels: 19, 22, 26, 27, 28, 29
Build Tools: 28.0.3, 29.0.0, 29.0.2
System Images: android-19 | Intel x86 Atom, android-19 | Google APIs Intel x86 Atom, android-22 | Google APIs Intel x86 Atom, android-22 | Google APIs Intel x86 Atom_64, android-27 | Google APIs Intel x86 Atom
IDEs:
Android Studio: Version 4.0.0.0 AI-193.6911.18.40.6514223
npmPackages:
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
The text was updated successfully, but these errors were encountered: