react-native-tab-view icon indicating copy to clipboard operation
react-native-tab-view copied to clipboard

Is it possible to dynamically add routes?

Open khat33b opened this issue 8 years ago • 6 comments

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)

khat33b avatar Sep 03 '18 10:09 khat33b

@satya164 Can you please confirm if this feature is available for this library?

khat33b avatar Sep 06 '18 11:09 khat33b

yes, its possible

Zohaibmalikdev avatar Sep 19 '18 07:09 Zohaibmalikdev

@Zohaibmalikdev Can you please provide a runnable snack to show how to do this?

khat33b avatar Sep 19 '18 11:09 khat33b

@khat33b this issue might solve your problem #465

muhammadridhuan avatar Sep 19 '18 11:09 muhammadridhuan

@muhammadridhuan I have tried that and it doesn't work. The same error appears. Can you please provide a runnable snack?

khat33b avatar Sep 27 '18 09:09 khat33b

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.

satya164 avatar Sep 27 '18 14:09 satya164