I was trying to understand the React through the React library, but couldn't understand what context
and updater
is, which is passed in to the Component.
Following was the code in the library.
function Component(props, context, updater) {
this.props = props;
this.context = context;
this.refs = emptyObject;
// We initialize the default updater but the real one gets injected by the
// renderer.
this.updater = updater || ReactNoopUpdateQueue;
}
What is the purpose of these things?