I\'m fairly new to React and React Native and I\'m having a play with React NativeBase.
I\'ve managed to get the following working within a single file, but now I\'
So I've figured out the issue...
It seems like React NativeBase does not allow you to have the
section outside of the main component. Something like this works:
code/index.ios.js
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
import {
Container,
Title,
Header,
Content,
} from 'native-base';
import MainContent from './main';
class AwesomeNativeBase extends Component {
render() {
return (
My awesome app
);
}
}
AppRegistry.registerComponent('AwesomeNativeBase', () => AwesomeNativeBase);
code/main.js
import React from 'react';
import { Text } from 'react-native';
export default class MainContent extends React.Component {
render() {
return (
Oh hello there!
);
}
}
So now if you notice, I have just the
tags in my main.js
and not the
tags... Not too sure why this makes a huge difference but it's good to know!