0

I have created app in which i have a 3 tabs to display webpages using React Native. Every time i switch to tab 2 from tab 1, and then back to tab 1, the webview its still working and not reload, but when i switch to tab 3, the tab 1 and 2 is reloaded when i back to tab 1 or tab 2 from tab 3. So, i think its not working for 3 tabs with WebView?

Im using react-native-router-flux for make a tabbar.

<Scene key="root" tabs={true}>
    <Scene key="menus">
        <Scene key="tabbar" tabs={true} tabBarStyle={{backgroundColor:'#f7f7f7'}}>
            <Scene key="Schedule" component={Schedule} title="Schedule" icon={TabIcon} hideNavBar={true}/>
            <Scene key="Chatbox" component={Chatbox} title="Chatbox" icon={TabIcon} hideNavBar={true}/>
            <Scene key="Home" component={Home} title="Home" icon={TabIcon} hideNavBar={true}/>
            <Scene key="Podcast" component={Podcast} title="Podcast" icon={TabIcon} hideNavBar={true}/>
            <Scene key="About" component={About} title="About" icon={TabIcon} hideNavBar={true}/>
        </Scene>
    </Scene>
</Scene>

And this is the code for WebView from the 1 of 3 pages:

var sourceChatbox = {uri: 'URL_HERE'};
return(
     <Container>
         {this.renderHeader()}

         <Content contentContainerStyle={{flex: 1, margin: 10, marginBottom: 60}}>
             <WebView source={sourceChatbox}/>
         </Content>
     </Container>
);

Thanks for your help.

ASHafizullah
  • 603
  • 1
  • 9
  • 22

1 Answers1

-1

I've never used react-native-router-flux before and currently more people are using react-navigation more, maybe you should check that out

william anputra
  • 159
  • 1
  • 4
  • 12
  • Nice, its work with react-navigation. But i dont know why its always reload with RN router flux, maybe some people know how to solve. Thanks before. – ASHafizullah Aug 02 '17 at 16:03