Actual code :
Refactor stage 1 (Make larger components in to small by creating small reusable components):
Refactor stage 2 (Don't use inl...
For further actions, you may consider blocking this person and/or reporting abuse
I like the idea of refactoring, but I think step 4 using the object rest/spread operator to pass multiple props is an anti pattern. While prop spreading is convenient and saves typing, what specific props are being passed through? What props is
<TextInput>supposed to support? If I needed to refactor<TextInput>using something other than<input>how would I know what props to support?Yes @christianschulze what you said is correct. rest/spread operator only suits for this example. My intention is first it will save typings and next i thought it is more readable. By seeing that snippet once can understand we are using
labelprop for label and rest of the props forinput