How to load the page only when user selects the tab ?
infaz opened this issue · 3 comments
infaz commented
How to load the page only when user selects the tab. Currently, It loads all the views initially. I want to load each view when user select each tab.
shivamtiwari8736 commented
Hi @infaz have you find any the solution for this. I am also going through the same problem.
r0b0t3d commented
You can create a placeholder view first. Then observe for current page changed then init the component yourself.
<IndicatorViewPager
onPageSelected={params => {
setCurrentPage(params.position);
}}
>
<View style={{ width }}>
<YourFirstPage />
</View>
<View style={{ width }}>
{isSecondPageInitialized && <YourSecondPage />}
</View>
</IndicatorViewPager>
shivamtiwari8736 commented
Ok thanks. I will try this.