import * as React from 'react' ; import { getDefaultOptions , getIndexNavigationOptions , Navigation } from './Navigation' ; const defaultOptions = getDefaultOptions ( ) ; export function load ( { context , deep : deepContext , config } ) { const resolved = ( ( ) => { try { return config ( ) ; } catch { return defaultOptions ; } } ) ( ) ; function fromJSON ( { type = defaultOptions . type , initialRouteName = defaultOptions . initialRouteName , screenOptions = defaultOptions . screenOptions , ... extraProps } = defaultOptions ) { function NavigationWrapper ( props ) { return ( < Navigation { ... props } { ... extraProps } initialRouteName = { initialRouteName } screenOptions = { screenOptions } deepContext = { deepContext } context = { context } navigator = { type } / > ) ; } NavigationWrapper . navigationOptions = getIndexNavigationOptions ( context ) ; return NavigationWrapper ; } return fromJSON ( resolved ) ; }