Answer the question
In order to leave comments, you need to log in
Is it possible to pass this props?
The question of best practices is whether it is good to do so or not.
Manuals usually write like this:
<SomeComponent
data={this.state.data}
onDataChange={this.updateData}
onDataDelite={this.deliteData}
/>
<SomeComponent that={this} />
const {
data,
updateData,
deliteData
} = this.props.that;
Answer the question
In order to leave comments, you need to log in
Not worth it. You should clearly specify the required props without passing any large config object or spread operator.
This is the API of the component, and it will be much clearer to immediately see all the fields used by the component at the place of its call. Let it look more cumbersome, but it is easier to read.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question