DEV Community

Discussion on: Why I stopped spreading props on React Components

Collapse
 
arberbr profile image
Arber Braja

I like to know all the time what im passing down to another component so expect cases of HOC, i rarely use spreading props. Ofcurse its easier but in the long run sending everything to another component is the best way to introduce issues. You will always have to check that parent component and see there what you are sending or checking ReactDevTools, console logging, etc ... you can eleminate all of this by explicitely telling at the first place what props are you going to pass down.

Collapse
 
aurelio profile image
Aurelio

Hi Arber, thanks for chiming in! Just to clarify if I'm understanding correctly, do you mean you also explicitly list all props for Higher Order Components or for everything except HOCs? Interested to see if I got your opinion!

Collapse
 
arberbr profile image
Arber Braja

HOC is one of the rare cases when im not explicit what i pass down and i use {...props}, almost everywhere else i like to specify what im passing where.