React-native无法呈现任何数据,

时间:2019-06-15 10:02:38

标签: javascript reactjs react-native rendering server-side

我正在努力为自己的本机设置环境。

除非我启动服务器,否则一切似乎工作正常。凡是react-native都无法渲染任何东西。它将文件显示为纯文本甚至html文件。

    **
   * Sample React Native App
   * https://github.com/facebook/react-native
   *
  * @format
  * @flow
  */

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


 const instructions = Platform.select({
 ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
 android:
 'ctrl+R on your keyboard to reload,\n' +
'Shake or press menu button for dev menu',
 });

 type Props  = {};
 export default class App extends Component<Props> {
 render() {
     return (..............

############################################## ###########

          **Below is the output in browser tab**
  <View style={styles.container}>
    <Text style={styles.welcome}>Welcome to React Native! Although    
       </Text>
    <Text style={styles.instructions}>To get started, edit 
   App.js</Text>
    <Text style={styles.instructions}>{instructions}</Text>
  </View>
);

0 个答案:

没有答案