<SideBarItem />
as export { SideBarItem = (<div class="flex-1 bg-blue font-bold, text-md d:none"></div>) }
Is that a bad thing? (Genuinely asking for opinions)E: added clarity
<SideBarItem />
as export { SideBarItem = (<div class="flex-1 bg-blue font-bold, text-md d:none"></div>) }
Is that a bad thing? (Genuinely asking for opinions)E: added clarity
It's how (nearly) everyone using React (or any frontend framework) + Tailwind will structure their code. And I'm not sure the author is arguing against Tailwind's utility in static styling scenarios.
I think the article's author would argue that once you move beyond static classes that Tailwind's class building becomes messy.
So <SideBarItem padding={4} active={true} /> would be cleaner in the authors mind if the exposed props get applied by some other tooling better suited for dynamic styling instead of simple string manipulation.
There is some merit to that argument. Building the class string can be cumbersome in some scenarios. But Tailwind "clicks" for me where other solutions do not. So I do it anyways.
YMMV; I prefer styled/ emotion-styled for primary, reusable blocks, and tailwind for one-off exceptions like a bit of extra margin.
<div class="side-bar-item"></div>
Or if it's a bad thing, I'm guilty too