In React quickstart, it is stated about Refs and Functional Components
that
You may not use the ref attribute on functional components because they don't have instances:
function MyFunctionalComponent() {
return <input />;
}
class Parent extends React.Component {
render() {
// This will *not* work!
return (
<MyFunctionalComponent
ref={(input) => { this.textInput = input; }} />
);
}
}
I don't fully understand the above statement and the example. So far from reading the tutorials, the only difference between functional and class component is that the latter can have things like constructor and lifecycle management functions.
What does the documentation mean when it says functional components don't have instances? Is it because they don't have this
pointer? Is this restriction coming from react or ES6?