So I love styled components, but I find the second one so much more readable, the first has too many components. If all you need is some padding or minimal styling use the inline style prop or css, and then for more complex UI components use a styled component. But a million "mainDiv" components feels unnecessary. It's different to have like a Card component or TextInput as a styled component
If all you need is some padding or minimal styling use the inline style prop or css
I totally agree. That would be the optimal approach, but I found myself having an awful time when I used margins or padding in any part of my CSS.
But a million "mainDiv" components feels unnecessary
Also something I completely agree with.
Thank you very much for the constructive feedback. I will definitely attempt to apply these to the project ASAP.
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
So I love styled components, but I find the second one so much more readable, the first has too many components. If all you need is some padding or minimal styling use the inline style prop or css, and then for more complex UI components use a styled component. But a million "mainDiv" components feels unnecessary. It's different to have like a Card component or TextInput as a styled component
If all you need is some padding or minimal styling use the inline style prop or css
I totally agree. That would be the optimal approach, but I found myself having an awful time when I used margins or padding in any part of my CSS.
But a million "mainDiv" components feels unnecessary
Also something I completely agree with.
Thank you very much for the constructive feedback. I will definitely attempt to apply these to the project ASAP.