I am working with a react native application, and it shows a warning in the console
import {createStackNavigator} from 'react-navigation-stack';
import {fromRight} from 'react-navigation-transitions';
const ApplyNowNav = createStackNavigator(
{
Home,
Profile,
},
{
headerMode: 'none',
transitionConfig: () => fromRight(),
}
);
WARN Deprecation in 'createStackNavigator':
transitionConfig' is removed in favor of the new animation APIs
Is there any solution to fix this issue?
You need to update your code to use to use the new Animation API: https://reactnavigation.org/docs/en/stack-navigator.html#animations
From the code you posted, you can change it to the following instead to have a slide from right animation:
import { createStackNavigator, TransitionPresets } from 'react-navigation-stack';
const ApplyNowNav = createStackNavigator(
{
Home,
Profile,
},
{
headerMode: 'none',
defaultNavigationOptions: {
...TransitionPresets.SlideFromRightIOS,
},
}
);
Works for me when I updated the code
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With