react-native-navigators
Advanced tools
Comparing version 0.0.1-beta.74 to 0.0.1-beta.75
@@ -20,12 +20,12 @@ import React, { PureComponent } from 'react'; | ||
this.handleCloseRoute = (route) => { | ||
const { closingRouteKey } = this.state; | ||
this.handleTransitionComplete(route); | ||
this.setState({ | ||
closingRouteKey: null, | ||
routes: this.state.routes.filter(route => route.key !== closingRouteKey) | ||
routes: this.state.routes.filter(r => r.key !== route.key) | ||
}); | ||
this.handleTransitionComplete(route); | ||
}; | ||
this.handleTransitionComplete = (route) => { | ||
if (this.props.navigation.state.isTransitioning) { | ||
this.props.navigation.dispatch(StackActions.completeTransition({ toChildKey: route.key })); | ||
const { navigation } = this.props; | ||
if (navigation.state.isTransitioning) { | ||
navigation.dispatch(StackActions.completeTransition({ toChildKey: route.key })); | ||
} | ||
@@ -32,0 +32,0 @@ }; |
@@ -31,2 +31,3 @@ import React, { PureComponent } from 'react'; | ||
{routes.map(route => { | ||
var _a, _b; | ||
const { key } = route; | ||
@@ -48,3 +49,4 @@ const descriptor = descriptors[key]; | ||
const SceneComponent = descriptor.getComponent(); | ||
return (<NativeStackScene key={key} transition={options.transition || NativeNavigatorTransitions.Default} closing={closingRouteKey === route.key} gestureEnabled={options.gestureEnabled !== false} translucent={options.translucent === true} transparent={options.transparent === true} popover={options.popover} onDidFocus={this.handleDidFocus} onDidBlur={this.handleDidBlur} route={route} style={options.cardStyle}> | ||
return (<NativeStackScene key={key} transition={((_b = (_a = navigation.dangerouslyGetParent()) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.isTransitioning) ? | ||
(options.transition || NativeNavigatorTransitions.Default) : NativeNavigatorTransitions.None} closing={closingRouteKey === route.key} gestureEnabled={options.gestureEnabled !== false} translucent={options.translucent === true} transparent={options.transparent === true} popover={options.popover} onDidFocus={this.handleDidFocus} onDidBlur={this.handleDidBlur} route={route} style={options.cardStyle}> | ||
<NativeStackSceneContainer> | ||
@@ -51,0 +53,0 @@ <NativeSceneView screenProps={screenProps} navigation={navigation} component={SceneComponent}/> |
@@ -1,2 +0,2 @@ | ||
import React from 'react'; | ||
import React, { useMemo } from 'react'; | ||
import { View, StatusBar, StyleSheet } from 'react-native'; | ||
@@ -13,6 +13,7 @@ const styles = StyleSheet.create({ | ||
export default function NativeStackHeader(props) { | ||
return (<View style={[ | ||
const style = useMemo(() => [ | ||
styles.container, | ||
{ backgroundColor: props.headerBackgroundColor, borderBottomColor: props.headerBorderColor } | ||
]}> | ||
], [props.headerBackgroundColor, props.headerBorderColor]); | ||
return (<View style={style}> | ||
{props.children} | ||
@@ -19,0 +20,0 @@ </View>); |
@@ -23,3 +23,3 @@ import React, { PureComponent } from 'react'; | ||
const { closing, translucent, transparent, transition, gestureEnabled, popover, style } = this.props; | ||
return (<RNNativeStackScene closing={closing} translucent={translucent} transparent={transparent} transition={transition} gestureEnabled={gestureEnabled} popover={popover} onDidFocus={this.onDidFocus} onDidBlur={this.onDidBlur} style={[style, StyleSheet.absoluteFill]}> | ||
return (<RNNativeStackScene closing={closing} translucent={translucent} transparent={transparent} transition={transition} gestureEnabled={gestureEnabled} popover={popover} onDidFocus={this.onDidFocus} onDidBlur={this.onDidBlur} style={style ? [style, StyleSheet.absoluteFill] : StyleSheet.absoluteFill}> | ||
{this.props.children} | ||
@@ -26,0 +26,0 @@ </RNNativeStackScene>); |
{ | ||
"version": "0.0.1-beta.74", | ||
"version": "0.0.1-beta.75", | ||
"name": "react-native-navigators", | ||
@@ -4,0 +4,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
287020
2860