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.
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.
This first imports the default of 'react'
as React
, the second imports the named export React