Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

react native use navigation outside component

// RootNavigation.js
import React from 'react';

export const navigationRef = React.createRef();

export function navigate(name, params) {
  navigationRef.current?.navigate(name, params);
}

// file where you have the navigation
import {navigationRef} from './path/to/RootNavigation';

      <NavigationContainer ref={navigationRef}>
      .....
        <Footer />
      </NavigationContainer>
Comment

PREVIOUS NEXT
Code Example
Javascript :: react native open simulators list 
Javascript :: sum javascript 
Javascript :: next router push state 
Javascript :: sort array by date 
Javascript :: js sort asendenet 
Javascript :: how to send emoji as ID discord.js 
Javascript :: ajax delete laravel 
Javascript :: javascript in line logic 
Javascript :: react native text input number only 
Javascript :: mock window jest js 
Javascript :: string contains javascirpt 
Javascript :: subtract two date javascript 
Javascript :: ngrok react.js 
Javascript :: regular expression to find a string between two characters 
Javascript :: remove element from array in an immutable way 
Javascript :: how to use sweet alert in vue js 
Javascript :: prodigy math game add item by id 
Javascript :: javascript hover event 
Javascript :: jquery id click 
Javascript :: import bootstrap css and js file in react 
Javascript :: react native navigation.navigate with params 
Javascript :: character limit regex 
Javascript :: js fetch send json 
Javascript :: typescript class constructor default values 
Javascript :: javascript get random array of integre in given range 
Javascript :: vue property decorator emit 
Javascript :: how to set/get cookie in JavaScript 
Javascript :: clear localstorage on click jquery 
Javascript :: setinterval vs settimeout js 
Javascript :: get child of child javascript 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =