My question relates to an implementation detail in the redux-form source code. Simply, I'd like some insight into the reasoning behind and thinking that went into the following snippet of code that can be found in src/createField.js
here and here.
this.context._reduxForm.register(
newName,
'Field',
() => nextProps.validate,
() => nextProps.warn
)
My question is not about how or where these functions are being used, but specifically why are these functions are wrapped in the manner that they are. For instance why not simply use:
this.context._reduxForm.register(
newName,
'Field',
nextProps.validate,
nextProps.warn
)
My guess is that it has to do with storing direct references to these functions in a parent component. My interest in this is related to another question I've asked on SO.