동일한 문제가있어서 zhaotai에서 제공 한 here 솔루션을 찾을 수있었습니다.
문제를 해결하려면 Navigator 구성 요소를 가져 오는 js 파일에서 다음 새 메서드를 정의하십시오.
Navigator.prototype.replaceWithAnimation = function (route) {
const activeLength = this.state.presentedIndex + 1;
const activeStack = this.state.routeStack.slice(0, activeLength);
const activeAnimationConfigStack = this.state.sceneConfigStack.slice(0, activeLength);
const nextStack = activeStack.concat([route]);
const destIndex = nextStack.length - 1;
const nextSceneConfig = this.props.configureScene(route, nextStack);
const nextAnimationConfigStack = activeAnimationConfigStack.concat([nextSceneConfig]);
const replacedStack = activeStack.slice(0, activeLength - 1).concat([route]);
this._emitWillFocus(nextStack[destIndex]);
this.setState({
routeStack: nextStack,
sceneConfigStack: nextAnimationConfigStack,
},() => {
this._enableScene(destIndex);
this._transitionTo(destIndex, nextSceneConfig.defaultTransitionVelocity, null,() => {
this.immediatelyResetRouteStack(replacedStack);
});
});
};
그렇다면, 당신은 대신 navigator.replaceWithAnimation(route)
를 호출 할 수 있습니다.
발견 된 솔루션? – Jickson