问题
I'm trying to get the information from the previous page to the current one.
I find this solution, but it doesn't work. Use the property prevScene
of Actions
but it return the same string of currentScente
. Why?
Furthermore, I see this relative question, but no one has answered.
回答1:
I had the same question but I couldn't find the right prop for it.
So I've passed a from
props while navigating to the currentScene and used it for further processing, like this:
Actions.currentSceneKey({ from: 'prevSceneKey' });
console.log(this.props.from); // prevSceneKey
来源:https://stackoverflow.com/questions/59507083/get-previously-scene-with-react-native-router-flux