Closed WesleyFaveri closed 4 years ago
Not sure what you're asking for, it's the same as in any situation
<ModalProvider>
<Navigator />
</ModalProvider>
Does this answer your question?
I made like:
const ModalProviderComponent = ({ children }) => (
<ModalProvider stack={stack}>
{children}
</ModalProvider>
);
export default ModalProviderComponent;
And
const AppNavigator = createAnimatedSwitchNavigator({
Login,
Dashboard,
},{
initialRouteName: 'Login',
});
const AppContainer = createAppContainer(AppNavigator);
...
return (
<ModalProvider>
<AppContainer />
</ModalProvider>
);
But Its not trigger initialRouteName: 'Login'
Hi @WesleyFaveri !
You don't need to create your ModalProviderComponent
(and I could see how you actually use it from your example).
import React from 'react'
import { ModalProvider, createModalStack } from 'react-native-modalfy'
import { createAppContainer, createAnimatedSwitchNavigator } from 'react-navigation'
const AppNavigator = createAnimatedSwitchNavigator({
Login,
Dashboard,
},{
initialRouteName: 'Login',
});
const AppContainer = createAppContainer(AppNavigator)
const stack = createModalStack(...)
export default class App {
return (
<ModalProvider stack={stack}>
<AppContainer />
</ModalProvider>
)
}
Closing for inactivity, feel free to re-open if needed.
@CharlesMangwa It's possible that OP was interested in using react-navigation's helpers to navigate to their modals. You still out there @WesleyFaveri?
Im missing a example to work modal with react-navigation, how i can work with AppNavigator