This repository was archived by the owner on May 20, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +19
-5
lines changed
Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 22
33import { createBrowserHistory } from 'history' ;
44import React from 'react' ;
5- import { NavigationActions , getNavigation } from '@react-navigation/core' ;
5+ import {
6+ NavigationActions ,
7+ getNavigation ,
8+ NavigationProvider ,
9+ } from '@react-navigation/core' ;
610
711/* eslint-disable import/no-commonjs */
812const queryString = require ( 'query-string' ) ;
@@ -89,7 +93,11 @@ export default function createBrowserApp(App) {
8993 ( ) => this . props . screenProps ,
9094 ( ) => this . _navigation
9195 ) ;
92- return < App navigation = { this . _navigation } /> ;
96+ return (
97+ < NavigationProvider value = { this . _navigation } >
98+ < App navigation = { this . _navigation } />
99+ </ NavigationProvider >
100+ ) ;
93101 }
94102 _dispatch = action => {
95103 const lastState = this . state . nav ;
Original file line number Diff line number Diff line change @@ -14,15 +14,21 @@ export default function handleServerRequest(
1414 // Get state from reducer
1515 const navigationState = Router . getStateForAction ( navigationAction ) ;
1616
17- // Prepare top-level navigation prop
1817 const actionSubscribers = new Set ( ) ;
19- const navigation = getNavigation (
18+
19+ // Prepare top-level navigation prop
20+ let navigation = null ;
21+ function getNavigation ( ) {
22+ return navigation ;
23+ }
24+
25+ navigation = getNavigation (
2026 Router ,
2127 navigationState ,
2228 ( ) => { } ,
2329 actionSubscribers ,
2430 ( ) => ( { } ) ,
25- ( ) => navigation
31+ getNavigation
2632 ) ;
2733
2834 // Get title from active screen options
You can’t perform that action at this time.
0 commit comments