Categories
React-Native

Adding Native-Base to your React Native App

Native-Base is an UI library to create your UIs much faster and simpler.

Create your app first.

react-native init MyApp

I recommend you to install Yarn.

npm install yarn

Go in your application’s main folder and install native-base.

npm install native-base --save

Now link native-base with your app.

react-native link

Let’s test our first app. Edit your App.js file like this.

import React from 'react';
import { Container, H1 } from 'native-base';

export default class App extends Component {
  render() {
    return (
      <Container>
          <H1>
            My first app with native-base.
          </H1>
      </Container>
    );
  }
}

Run your app.

react-native run-android