Is it possible to dynamically add routes?
Is it possible to dynamically add routes in react-native-tab-view? I keep getting Invariant Violation even with the simplest examples. Can any one add a working example to show how to do this?
Invariant Violation: Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Check the render method of `SceneComponent`.
This error is located at:
in SceneComponent (at SceneMap.js:16)
in RCTView (at View.js:43)
in AndroidViewPager (at ViewPagerAndroid.android.js:247)
in ViewPagerAndroid (at PagerAndroid.js:154)
in PagerAndroid (at TabView.js:59)
in RCTView (at View.js:43)
in RCTView (at View.js:43)
@satya164 Can you please confirm if this feature is available for this library?
yes, its possible
@Zohaibmalikdev Can you please provide a runnable snack to show how to do this?
@khat33b this issue might solve your problem #465
@muhammadridhuan I have tried that and it doesn't work. The same error appears. Can you please provide a runnable snack?
Can you provide a runnable snack? From your error, it seems like you are not providing a valid component.
Note that on android the tabview will unmount and remount all the screens due to the limitations in ViewPagerAndroid. You should use a different pager using the renderPager prop if you don't want this behavior.