Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to focus icon of active screen react native

// use prop {focused} like in example:

<Tab.Screen
    name="Home"
    component={HomeScreen}
    options={{
       tabBarIcon: ({ focused }) => (
            <Image
               source={require("./assets/lock.png")}
               style={{
                  width: 25,
                  height: 25,
                  tintColor: focused ? "#e91e63" : "#748c94",
               }}
            />
       ),
    }}
/>

// you'll find more informations here:
// https://reactnavigation.org/docs/tab-based-navigation/
// and here
// https://youtu.be/gPaBicMaib4?t=604
 
PREVIOUS NEXT
Tagged: #focus #icon #active #screen #react #native
ADD COMMENT
Topic
Name
3+2 =