Updated AnimationOptions to match native implementation #4865
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
setStackRootproperty, since it is referenced inRNNTransitionsOptionsand used inRNNCommandsHandlersetRootandshowModaltype to match all the other options (StackAnimationOptions), since the native code uses the same type for all of them (RNNScreenTransitionon iOS).This is an update of PR #4856 which was closed without any discussion.
Below are more details on which parts of the native code are not matching the current types:
Added
setStackRootpropertyIn
RNNNavigationOptions.hyou can see that the type of theanimationsproperty isRNNTransitionsOptions:In
RNNTransitionsOptions.hyou can see that there is in fact a property forsetStackRoot:This property is then being used in
RNNCommandsHandler.h:Perhaps the native code should check the
pushproperty instead ofsetStackRoot. If that is the case I can make that change, and and removesetStackRootfrom the native and typescript code.Changed
setRootandshowModaltype to match all the other optionsIn
RNNTransitionsOptions.hyou can see that the type for all of the animations is the same:RNNScreenTransition, includingshowModal,setRootanddismissModal:In
RNNScreenTransitionyou can see the properties for this type, which correspond to the ones inOptionsAnimationSeparatenot the ones inOptionsAnimationProperties:For example the
showModalproperty is used inRNNRootViewControllerandRNNNavigationControllerin the following method:The
RNNModalAnimationconstructor expects an object ofRNNScreenTransitiontype, and uses thecontentandtopBarproperties of this object in its code.If the native code needs to be changed it's a much larger effort, so the typings are meant to reflect the current status of the native code until it's changed (if that happens).