Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

304
Views
React Native - How to get initial navigation state in React Navigation

I'm trying to get initial state in the same format as onStateChange prop provides in NavigationContainer. onStateChange doesn't fire on initial render. In the example below, I managed to get state when navigating between screens, but not on the first one. Any ideas?

export default function App() {
  const [pageState, setPageState] = React.useState();

  return (
    <NavigationContainer onStateChange={(state) => setPageState(state)}>
      <RootNavigation />
    </NavigationContainer>
  );
}

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Try using the onReady method from the NavigationContainer From the docs: https://reactnavigation.org/docs/navigation-container#onready

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!