There are 2 ways to create components in a reactor:
1) NewComponent extends Component {...}
1) NewComponent extends React.Component {...}
What's the difference? What pitfalls might be in the future?

1 Answers 1

Both options are the same, just in the 1st case we explicitly import the Component from the react library and inherit from it:
import React, {Component} from'react';
class App extends Component {}

import React from'react';
class App extends React.Component {}
  • Here he writes that components are not displayed correctly in devtools. It is interesting for what other purposes 2 methods were created
    https://maxfarseer.gitbooks.io/react-router-course...
    – Happy Lawnmower Aug 18 '16 at 01:10
  • Happy Lawnmower: The thing is, we pass the"Component" argument to the exported function, so when we inherit, it is not the component we expect. Perhaps it is worth renaming this argument then nothing will break. – Undercover32 Aug 18 '16 at 01:36