Skip to content
Advertisement

Destructuring a function call

Assuming the following code:

JavaScript

EsLint gives out the following error:

JavaScript

While the current code is clear and concise, if I still wanted to destructure the code and make EsLint happy, how could I do it ?

Advertisement

Answer

The docs for this rule say that properties of props should be destructured before using them, so just do that:

JavaScript
Advertisement