diff --git a/example/src/index.tsx b/example/src/index.tsx index 1249409..c36aca6 100644 --- a/example/src/index.tsx +++ b/example/src/index.tsx @@ -1,5 +1,5 @@ // app entry -import React, { useState } from 'react'; +import React, { useState, Children } from 'react'; import { AppRegistry, Platform, @@ -8,21 +8,22 @@ import { ViewStyle, StyleProp, Button, + SafeAreaView, } from 'react-native'; import { Link, Navigator, - Tabs, Pager, - Stack, Tabbar, Tab, + Tabs, + Stack, } from 'react-navigation-library'; import { FlatList, BorderlessButton } from 'react-native-gesture-handler'; function PagerApp() { - const [activeIndex, setActiveIndex] = useState(0); + const [activeIndex, setActiveIndex] = useState(-1); function handleChange(index: number) { setActiveIndex(index); @@ -30,34 +31,40 @@ function PagerApp() { return ( - - + + 0 setActiveIndex(activeIndex + 1)}> Next - - + + 1 setActiveIndex(activeIndex + 1)}> Next - - + + 2 setActiveIndex(activeIndex + 1)}> Next - - + + 3 - - + + 4 - + - +