Jacse / react-native-app-intro-slider

Simple and configurable app introduction slider for react native
MIT License
1.66k stars 330 forks source link

renderNextButton not working, when using renderPagination. #187

Closed TamerlanG closed 4 years ago

TamerlanG commented 4 years ago

Description

As the title says, when you use renderPagination, then renderNextButton just doesn't render my custom button.

const  renderItem  =  ({item})  => {
  return  <SlideManager current_slide={item.name} />;
};

const  renderNextButton  =  ()  => {
   return (
      <ButtonContainer>
          <AppIntroButton  />
      </ButtonContainer>
   );
};

const  renderPagination  =  index  => (
  <PaginationContainer>
    <Pagination  size={slides.length} current={index} />
  </PaginationContainer>
);

return (
<>
  <AppIntroSlider
    data={slides}
    showNextButton 
    renderPagination={renderPagination}
    renderItem={renderItem}
    renderNextButton={renderNextButton}
   />
</>

);

Version

"react-native": "0.62.2"
"react-native-app-intro-slider": "^4.0.2"

SherozeAli commented 4 years ago

image

Hi there ! Just remove the button(ButtonContainer) from renderNextButton just use the View like in screenshot Button will not work here ! This works for me Make view& Text looks like button style yourself

TamerlanG commented 4 years ago

@SherozeAli If it's a view then I cannot press it, I believe it should be a touchable opacity

SherozeAli commented 4 years ago

@SherozeAli If it's a view then I cannot press it, I believe it should be a touchable opacity @TamerlanG I only accepts View bcz of its pre-defined functionality ! button click won't work ! it has its own listener !

Jacse commented 4 years ago

renderPagination covers both the pagination dots and any buttons, so if you want to render buttons you should do so inside the renderPagination-function. I'll make sure to update the README to document this better.