Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
);
const EXAMPLES = {
Fade,
Modal,
Gesture,
CardStack,
SharedEl,
};
const AppNavigator = createSwitchNavigator({
Examples,
...EXAMPLES,
});
const StatefulAppNavigator = createAppContainer(AppNavigator);
// const StatefulAppNavigator = createAppContainer(Fade);
// const StatefulAppNavigator = createAppContainer(Modal);
// const StatefulAppNavigator = createAppContainer(Gesture);
// const StatefulAppNavigator = createAppContainer(CardStack);
// const StatefulAppNavigator = createAppContainer(SharedEl);
const App = () => (
);
Expo.registerRootComponent(App);
style={{backgroundColor: Styles.globalColors.white}}
>
)
const RootStackNavigator = createSwitchNavigator(
{
loading: {screen: SimpleLoading},
loggedIn: LoggedInStackNavigator,
loggedOut: LoggedOutStackNavigator,
},
{initialRouteName: 'loading'}
)
const AppContainer = createAppContainer(RootStackNavigator)
class RNApp extends React.PureComponent {
private nav: any = null
// TODO remove this eventually, just so we can handle the old style actions
dispatchOldAction = (old: any) => {
const nav = this.nav
if (!nav) {
throw new Error('Missing nav?')
}
const actions = Shared.oldActionToNewActions(old, nav._navigation) || []
try {
actions.forEach(a => nav.dispatch(a))
} catch (e) {
logger.error('Nav error', e)
style={{backgroundColor: Styles.globalColors.white}}
>
)
const RootStackNavigator = createSwitchNavigator(
{
loading: {screen: SimpleLoading},
loggedIn: LoggedInStackNavigator,
loggedOut: LoggedOutStackNavigator,
},
{initialRouteName: 'loading'}
)
const AppContainer = createAppContainer(RootStackNavigator)
class RNApp extends React.PureComponent {
private nav: any = null
// TODO remove this eventually, just so we can handle the old style actions
dispatchOldAction = (old: any) => {
const nav = this.nav
if (!nav) {
throw new Error('Missing nav?')
}
const actions = Shared.oldActionToNewActions(old, nav._navigation) || []
try {
actions.forEach(a => nav.dispatch(a))
} catch (e) {
logger.error('Nav error', e)
const RootStack = createStackNavigator(
{
Tabs: TabNavigator,
SignIn: SignInScreen,
SignUp: SignUpScreen,
QRCode: QRCodeScreen,
},
{
initialRouteName: 'Tabs',
mode: 'modal',
defaultNavigationOptions,
}
);
export default createAppContainer(RootStack);
function renderIcon(
IconComponent: any,
iconName: string,
iconSize: number,
isSelected: boolean,
theme: 'light' | 'dark'
) {
let color = isSelected ? Colors[theme].tabIconSelected : Colors[theme].tabIconDefault;
return ;
}
const styles = StyleSheet.create({
icon: {
marginBottom: Platform.OS === 'ios' ? -3 : 0,
tabBarIcon: ({tintColor}) => (
),
tabBarVisible: isTabBarVisible(navigation),
}),
transitionConfig: () => fadeIn(0, true),
}
);
export const tabNavigator = createBottomTabNavigator({
stack: stackNavigator,
modal: modalNavigator,
fade: fadeNavigator,
});
const AppContainer = createAppContainer(tabNavigator);
type PropsType = {};
export class ReactNavigationScreen extends React.Component {
render() {
return (
);
}
}
import { createAppContainer } from '@react-navigation/native';
import MainTabNavigator from './MainTabNavigator';
export default createAppContainer(MainTabNavigator);
},
};
return acc;
}, {}),
},
{
mode: 'modal',
headerMode: 'none',
defaultNavigationOptions: {
gesturesEnabled: false,
},
}
);
const App = createAppContainer(Root);
export default App;
registerRootComponent(App);
},
};
return acc;
}, {}),
},
{
mode: 'modal',
headerMode: 'none',
defaultNavigationOptions: {
gesturesEnabled: false,
},
}
);
const Navigation = createAppContainer(Root);
const App = () => {
let [theme, setTheme] = React.useState('light');
return (