[英]How to interpret this import statement in Javascript
I've come across code like this:我遇到过这样的代码:
import React, { Component } from 'react';
What is the difference between that and this:那和这有什么区别:
import { React, Component } from 'react';
I have rarely seen anything outside the curly braces.我很少看到花括号之外的任何东西。
第一个导入默认的'react'
作为React
,第二个导入命名的 export React
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.