Учебники

React Native – приложение

Если вы откроете приложение по умолчанию, вы увидите, что файл app.js выглядит

import React from 'react';
import { StyleSheet, Text, View } from 'react-native';

export default class App extends React.Component {
   render() {
      return (
         <View style = {styles.container}>
            <Text>Open up App.js to start working on your app!</Text>
            <Text>Changes you make will automatically reload.</Text>
            <Text>Shake your phone to open the developer menu.</Text>
         </View>
      );
   }
}

const styles = StyleSheet.create({
   container: {
      flex: 1,
      backgroundColor: '#fff',
      alignItems: 'center',
      justifyContent: 'center',
   },
});

Выход

Работает над приложением

Привет, мир

Чтобы отобразить простое сообщение с надписью «Welcome to Tutorialspoint», удалите часть CSS и вставьте печатное сообщение, заключенное в теги <text> </ text> внутри <view> </ view>, как показано ниже.