简体   繁体   中英

Javascript complex destructuring in function argument

I am confused seeing a syntax somewhere in my React code as below. Assuming there is some destructuring going on here. Would that be correct?

function xyz ({param1, data: {response, error, classes}, param3}) {

}

Yes destructuring is happening, it may be useful at certain points, but it is better to separate the inputs of the function or use another function for example as params.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM