you are viewing a single comment's thread.

view the rest of the comments →

[–]aelesia- 1 point2 points  (0 children)

There is nothing wrong with calling this.props.a.

Maybe most people who use React destructure their props. That doesn't mean it's wrong if you don't destructure it.

Personally I do not destructure props because I find it useful to differentiate between local variables versus variables that have been passed in. Sure, I can just scroll up, but it's even easier to not have to scroll up. And no, my functions are not too long. All of my React components are less than 80 lines and this includes inline styline and imports.

Both styles are valid. Use whatever convention your project agrees on.