mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-06 17:28:54 +08:00
feat(context): refactor passing navigation context (#3668)
* feat(context): refactor passing navigation context * remove commented code in example * adjust src/views/withNavigationFocus.js * refactor stuff * extract scene to variable * Add test * Apply CR comments * remove junk * bring back screen mode header
This commit is contained in:
committed by
Brent Vatne
parent
fd75e9c14c
commit
fcbf78e658
@@ -15,6 +15,7 @@ import Card from './StackViewCard';
|
||||
import Header from '../Header/Header';
|
||||
import NavigationActions from '../../NavigationActions';
|
||||
import SceneView from '../SceneView';
|
||||
import { NavigationProvider } from '../NavigationContext';
|
||||
|
||||
import TransitionConfigs from './StackViewTransitionConfigs';
|
||||
import * as ReactNativeFeatures from '../../utils/ReactNativeFeatures';
|
||||
@@ -194,9 +195,11 @@ class StackViewLayout extends React.Component {
|
||||
let floatingHeader = null;
|
||||
const headerMode = this._getHeaderMode();
|
||||
if (headerMode === 'float') {
|
||||
floatingHeader = this._renderHeader(
|
||||
this.props.transitionProps.scene,
|
||||
headerMode
|
||||
const { scene } = this.props.transitionProps;
|
||||
floatingHeader = (
|
||||
<NavigationProvider value={scene.descriptor.navigation}>
|
||||
{this._renderHeader(scene, headerMode)}
|
||||
</NavigationProvider>
|
||||
);
|
||||
}
|
||||
const {
|
||||
|
||||
Reference in New Issue
Block a user