我使用库react-native-app-intro-slider
\n\n我制作了自定义 renderPagination,但无法在库中使用 goToSlide 方法。
\n\n我已经尝试过自定义分页登录注册按钮,但我也无法使用。
\n\n这是我的代码:
\n\nconst _renderPagination = (activeIndex) => {\nreturn (\n <View style={style.paginationContainer}>\n <SafeAreaView>\n <View style={style.paginationDots}>\n {slides.length > 1 &&\n slides.map((_, i) => (\n <TouchableOpacity\n key={i}\n style={[\n style.dot,\n i === activeIndex\n ? {backgroundColor: '#9948fc'}\n : {backgroundColor: 'rgba(0, 0, 0, .2)'},\n ]}\n onPress={() => goToSlide(activeIndex, true)} //Error\n />\n ))}\n </View>\n {activeIndex === slides.length - 1 ? (\n <View>\n <TouchableOpacity\n style={[style.button, {backgroundColor: '#9948fc'}]}\n onPress={() => navigation.navigate('signup')}\n >\n <Text style={style.buttonText}>\xed\x9a\x8c\xec\x9b\x90\xea\xb0\x80\xec\x9e\x85</Text>\n </TouchableOpacity>\n <TouchableOpacity\n style={[style.button, {backgroundColor: 'transparent'}]}\n onPress={()=> …Run Code Online (Sandbox Code Playgroud) react-native ×1