Migration from 0.x to 2.x

Steps for Migrating NativeBase from v0.x to v2.x

General Syntax to apply theme
import {Container, Content, Text, StyleProvider, getTheme} from 'native-base/backward';
import React, {Component} from 'react-native';
import variable from './Themes/variable';
​
export default class ThemeExample extends Component {
    render() {
        return (
            <Container>
                <StyleProvider  style={getTheme(variable)}>
                    <Content>
                        <Text>
                            I have changed the text color.
                        </Text>
                    </Content>
                </StyleProvider>
            </Container>
        );
    }
}

Styles to the Component

General Syntax of style.js object
export default {
  container: {
    backgroundColor: '#FBFAFA',
  },
  text: {
    color: 'red',
  },
}

General Syntax to overwrite default styles
import {Container, Content, Text, getTheme} from 'native-base/backward';
import React, {Component} from 'react-native';
// Style object import
import styles from './style';
​
export default class ThemeExample extends Component {
    render() {
        return (
            <Container style={styles.container}>
                  <Content>
                      <Text style={styles.text}>
                          I have changed the text color.
                      </Text>
                  </Content>
            </Container>
        );
    }
}