score:11

Accepted answer

the basic difference is, when it a component, react will run/add all its lifecycle methods. this will be useful when you have state in your component. when you use this component, react will create a react component instance which will have all the lifecycle methods and other hooks added to it.

class app extends react.component{
  ...
}

in some cases, you won't use state. in those cases, adding all those lifecycle methods are unnecessary. so, react gives you an way to create an component which will have render alone. it is called purecomponent. when you use this, there is no need to create a new component instance because there is no lifecycle methods here. it'll just be a function which can take props and return react elements.

class app extends react.purecomponent{
   ...
}

hope this helps!

[update]

what is a component and a component instance?

technically, a component in react is a class or a function.

example:

class app extends react.component{
...
}

//stateless component
const app = (props) => {
...
}

when you use that component, it'll be instantiated, more like new app(). but, react does it by itself in a different way.

for example:

render(){
   return <app/> //instance of the component app
}

instances are required because, each instance can perform individually. instances are a copy of original class.

simple answer is, components will be a class and component instance will be the copy/instance of the class and will be used in render

hope this explains!

score:5

a "react component instance" is just an instance that was created from a previously defined class component. see the example below (es6/jsx) which contains both props and state:

class mycomponentclass extends react.component {
    constructor(props) {
        super(props);
        // set initial state
        this.state = {
            example: 'example'
        };
    }

    render() {
        return <div>
            <div>{this.state.example}</div>
            <div>{this.props.example}</div>
        </div>;
    }
}

if you have no need for state in your component you can use a pure, stateless, functional react component like so:

function mystatelessfunctionalcomponent(props) {
    return <div>{this.props.example}</div>;
}

here is some more information about stateless react components when they were introduced in react v0.14. since then you have the ability to use hooks starting in react v16.8, which allow you to define a functional component that has state or makes use of the component lifecyle.

as mentioned in some other comments, there are many performance benefits when using stateless components. these types of components are perfect for when you want something purely presentational as an example.

since there’s no state or lifecycle methods to worry about, the react team plans to avoid unnecessary checks and memory allocations in future releases.


Related Query

More Query from same tag