question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Configure UI Kitten with react native navigation

See original GitHub issue

How to configure UI Kitten if app is initialized with react-navigation?

import {createStackNavigator, createAppContainer} from 'react-navigation';
import Login from "./components/Login";
import Issues from "./components/Issues";
import Issue from "./components/Issue";
import Create from "./components/Create";
import Time from "./components/Time";

const MainNavigator = createStackNavigator({
    Home: {screen: Issues},
    Login: {screen: Login},
    Issues: {screen: Issues},
    Issue: {screen: Issue},
    Create: {screen: Create},
    Time: {screen: Time},
}, {
    transitionConfig: () => ({
        transitionSpec: {
            duration: 0,  // Set the animation duration time as 0 !!
        },
    }),
});

const App = createAppContainer(MainNavigator);

export default App;

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
iyobocommented, Oct 23, 2019

Anyway, here is how I got it to work:

import React from 'react';
import {mapping, light as lightTheme} from '@eva-design/eva';
import {ApplicationProvider, Button, Layout, Text} from 'react-native-ui-kitten';
import {ScreenOrientation} from 'expo';
import {StatusBar} from 'react-native';
import {createStackNavigator} from "react-navigation-stack";
import {EvaIconsPack} from '@ui-kitten/eva-icons';
import {createAppContainer} from "react-navigation";

import WelcomePage from './pages/WelcomePage';

const RoutedApp = createAppContainer(createStackNavigator({
    Home: {
        screen: WelcomePage,
    },
}));

export default class App extends React.Component {

    componentDidMount() {
        ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.LANDSCAPE_LEFT);
    }

    render() {
        return (
            <ApplicationProvider mapping={mapping} theme={lightTheme}>
                <RoutedApp/>
            </ApplicationProvider>
        );
    }
}
0reactions
iyobocommented, Oct 23, 2019

Screen oriententation is just a private need. You can ignore that.

The code snippet I posted is just to demonstrate how nothing much has changed. By the rules of react, whatever React Navigation’s createAppContainer function returns will be a component that you can use within your component tree.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure Navigation - UI Kitten - GitHub Pages
Configure Navigation. This guide will help you to configure the app to navigate between screens. UI Kitten has built-in components to fit React...
Read more >
Using React Navigation 5 with UI Kitten
In this example, we're using a createStackNavigator function to create simple stack navigation between Sign In, Sign Up and Reset Password ...
Read more >
How to Create React Native (UI Kitten) Drawer and Bottom ...
Type expo init ui-kitten-nav in your terminal and press enter. · Press enter to accept blank (a minimal app as clean as an...
Read more >
How can Top Navigation component from UI Kitten can be ...
import React from 'react'; import {createStackNavigator} from '@react-navigation/stack'; import routes from '.
Read more >
Top 5 react-native-ui-kitten Code Examples - Snyk
root} contentContainerStyle={styles.rootContainer}> {items} </ScrollView> ) } } let styles = RkStyleSheet.create( ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found