Navigation

    论坛 - React Native中文社区

    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Search
    1. Home
    2. yuanyouhdq
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    yuanyouhdq

    @yuanyouhdq

    0
    Reputation
    1
    Posts
    153
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    yuanyouhdq Follow

    Best posts made by yuanyouhdq

    This user hasn't posted anything yet.

    Latest posts made by yuanyouhdq

    • 遇到一个新的问题,初始化项目今天和昨天的App.js不一样,新的App.js在vscode显示下滑线报错,请各位指教

      新的App.js 而且新的在vscode这里是显示报错的

      /**

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

      import React, {Fragment} from 'react';
      import {
      SafeAreaView,
      StyleSheet,
      ScrollView,
      View,
      Text,
      StatusBar,
      } from 'react-native';

      import {
      Header,
      LearnMoreLinks,
      Colors,
      DebugInstructions,
      ReloadInstructions,
      } from 'react-native/Libraries/NewAppScreen';

      const App = () => {
      return (
      <Fragment>
      <StatusBar barStyle="dark-content" />
      <SafeAreaView>
      <ScrollView
      contentInsetAdjustmentBehavior="automatic"
      style={styles.scrollView}>
      <Header />
      <View style={styles.body}>
      <View style={styles.sectionContainer}>
      <Text style={styles.sectionTitle}>Step One</Text>
      <Text style={styles.sectionDescription}>
      Edit <Text style={styles.highlight}>App.js</Text> to change this
      screen and then come back to see your edits.
      </Text>
      </View>
      <View style={styles.sectionContainer}>
      <Text style={styles.sectionTitle}>See Your Changes</Text>
      <Text style={styles.sectionDescription}>
      <ReloadInstructions />
      </Text>
      </View>
      <View style={styles.sectionContainer}>
      <Text style={styles.sectionTitle}>Debug</Text>
      <Text style={styles.sectionDescription}>
      <DebugInstructions />
      </Text>
      </View>
      <View style={styles.sectionContainer}>
      <Text style={styles.sectionTitle}>Learn More</Text>
      <Text style={styles.sectionDescription}>
      Read the docs to discover what to do next:
      </Text>
      </View>
      <LearnMoreLinks />
      </View>
      </ScrollView>
      </SafeAreaView>
      </Fragment>
      );
      };

      const styles = StyleSheet.create({
      scrollView: {
      backgroundColor: Colors.lighter,
      },
      body: {
      backgroundColor: Colors.white,
      },
      sectionContainer: {
      marginTop: 32,
      paddingHorizontal: 24,
      },
      sectionTitle: {
      fontSize: 24,
      fontWeight: '600',
      color: Colors.black,
      },
      sectionDescription: {
      marginTop: 8,
      fontSize: 18,
      fontWeight: '400',
      color: Colors.dark,
      },
      highlight: {
      fontWeight: '700',
      },
      });

      export default App;

      /***************************************************************/

      旧的App.js

      /**

      • 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';
      import Home from './app/pages/Home';

      const instructions = Platform.select({
      ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
      android:
      'Double tap 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 (
      <Home/>
      );
      }
      }

      const styles = StyleSheet.create({
      container: {
      flex: 1,
      justifyContent: 'center',
      alignItems: 'center',
      backgroundColor: '#F5FCFF',
      },
      welcome: {
      fontSize: 20,
      textAlign: 'center',
      margin: 10,
      },
      instructions: {
      textAlign: 'center',
      color: '#333333',
      marginBottom: 5,
      },
      });

      posted in 讨论区
      yuanyouhdq
      yuanyouhdq