Tab navigations - URL instead of component

374 Views Asked by At

I have a tab navigator and a tab screen;

<Tab.Screen
      name="icon"
      onPress={ ()=>{ Linking.openURL('https://google.com')}}
      component={LeagueTableMini}
      options={{
        title: '',
        tabBarIcon: ({size,focused,color}) => {
          return (
            <Image
              style={{ marginBottom:8,width: 70, height: 80 }}
              source={{
                uri:
                  'https://bbc.co.uk/mobileapplogo.png',
              }}
            />
          );
        },
      }}
    />

I've added a Linking to open up a URL as I don't want to open a component within the app, it doesn't work and if I omit the component parameter react throws an error.

How can I jump to a browser / URL from a tab navigation?

1

There are 1 best solutions below

1
On

You can put your URL in a web-view and then tab navigate to that component