2017-04-06 68 views
-2

我在部份新的,我想不出有什麼是錯在這行代碼。 我試圖改變線路和誤差只有改變話題。意外的令牌,預計{(26:2)

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

 
import { Textbox } from './src/Textbox'; 
 

 
export default class App extends React.Component { 
 
    render() { 
 
    return (
 
     <View style={styles.container}> 
 
     <Text>Hello Hector. 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> 
 
    ); 
 
    } 
 
}; 
 

 
export class Textbox extends Component ({ 
 
    render() { 
 
    return (
 
     <View style={styles.useless}> 
 
     <Textbox /> 
 
     </View> 
 
    ); 
 
    }, 
 
});

回答

0

你有一個語法錯誤上你的第二類:

export class Textbox extends Component ({ <---shouldnt have parans 
    render() { 
    return (
     <View style={styles.useless}> 
     <Textbox /> 
     </View> 
    ); 
    }, 
}); <---shouldnt have parans 

將其更改爲:

export class Textbox extends Component { 
    render() { 
    return (
     <View style={styles.useless}> 
     <Textbox /> 
     </View> 
    ); 
    } 
};