这是多余的吗? - 从'react'导入React,{Component};

tha*_*nce 0 reactjs create-react-app

在我Create React App创建的文件的顶部App.js是该行import React, { Component } from 'react';

不会React导入所有内容......如果是,那么为什么{ Component }需要?

jma*_*svt 6

Component单独导入允许您使用Component而不是React.Component.这很方便.