"SyntaxError: Unexpected token" but no token is specified, the error is indicated to be on whitespace

"SyntaxError: Unexpected token" but no token is specified, the error is indicated to be on whitespace

我正在关注 this tutorial,因为我是 React Native 的初学者(并且 Javascript 就此而言),并且我 运行 正在 "Unexpected token" 语法错误,但它没有告诉我哪个字符是意外的。我在下面粘贴了我的代码以及错误消息。我在这里做错了什么吗?

EmojiDict.js

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

class EmojiDict extends Component {
  state = {
    'A': 'A Smiley',
    'B': 'B Rocket',
    'C': 'C Atom Symbol'
  };

  render() {
    return {
      <View style={styles.container}>
          <Text>{this.state['A']}</Text>
      </View>
    };
  }
}

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

export default EmojiDict;

App.js

import React, { Component } from 'react';

import EmojiDict from './src/components/EmojiDict';

export default class App extends Component {
    render() {
        return <EmojiDict />;
    }
}

错误信息

error: SyntaxError: /Users/johnking/Documents/Projects/HelloWorld/src/components/EmojiDict.js: Unexpected token (13:6)

  11 |   render() {
  12 |     return {
> 13 |       <View style={styles.container}>
     |       ^
  14 |           <Text>{this.state['A']}</Text>
  15 |       </View>
  16 |     };

你应该是return()而不是{}。

render() {
    return (
      <View style={styles.container}>
          <Text>{this.state['A']}</Text>
      </View>
    );
  }