I'm using react-navigation in my react-native project in order to handle my navigation and routes.
In my case, i have a ViewA and a ViewB.
The ViewA needs informations that i'm filling in my ViewB.
The userflow is ViewA -> ViewB -> ViewA.
** VIEW A **
import React from "react";
import { Button, Text, View } from "react-native";
class ViewA extends React.Component {
state = { selected: false };
onSelect = data => {
this.setState(data);
};
onPress = () => {
this.props.navigate("ViewB", { onSelect: this.onSelect });
};
render() {
return (
<View>
<Text>{this.state.selected ? "Selected" : "Not Selected"}</Text>
<Button title="Next" onPress={this.onPress} />
</View>
);
}
}
.
**VIEW B**
import React from "react";
import { Button } from "react-native";
class ViewB extends React.Component {
goBack() {
const { navigation } = this.props;
navigation.goBack();
navigation.state.params.onSelect({ selected: true });
}
render() {
return <Button title="back" onPress={this.goBack} />;
}
}
What i'm trying to do is : Instead of opening my ViewB from left to right, i'd like it to be opened from bottom to up ('above' the ViewA) and having a close transition 'top-bottom'. Such as a Modal.
My issue is, i want to keep my StackNavigator as it is. And would like to custom this transition.
I don't want a Modal.
Thanks for your time and your help