Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tab bar navigation without component screen render

Is there a way to press on tab bar and not render component screen? i have been passing null function but it still renders blank screen. i want that wherever you press it stays on home screen.

like image 250
Josip Marić Avatar asked Sep 19 '25 02:09

Josip Marić


1 Answers

Add a listener to the Screen.

          component={() => null}
          listeners={() => ({
            tabPress: (e) => {
              e.preventDefault(); // Prevents navigation
              // Your code here for when you press the tab
            },
          })}
like image 121
Maxwell Avatar answered Sep 21 '25 16:09

Maxwell