What's the difference between
type Props = {};
export default class App extends Component<Props>
And
export default class App extends React.Component
Both ways of extending seem to work without any errors.
<Props> part is just Flow feature for type checking. It will be ignored if you haven't integrated Flow.
Component and React.Component is the same class from react package, a difference only in importing:
import React from 'react';
export default class App extends React.Component
import React, { Component } from 'react';
export default class App extends Component
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With