TGViewer
🤖 Coding News ⚡️ 🤖 Coding News ⚡️ @codingnews · 22.9K subscribers
Post #1076 11.7K
​​I’m sure you must’ve seen react components where there are a bunch of props being passed down, and almost always the majority of those props are boolean flags. These flags help you conditionally show a specific part of the component in a different way or sometimes even completely remove that part from the render tree. But this approach is a scaling nightmare. This component is now open to “one-off“ condition blocks.

⏱️ 6 minutes read

#React
Medium Compound Components Pattern in React The problem
  • 👍 12
  • ❤ 2
  • 👾 1
More from @codingnews
  1. Dec 19, 2024🤖 Coding News ⚡️ pinned «​​Our RISE community has been on fire, exploring the breathtakin…
  2. Dec 19, 2024​​There are millions of articles explaining how to fix the error above, but what exactly i…
  3. Nov 22, 2024​​Have you ever tried to register for an app, only to find out that your preferred usernam…
  4. Nov 10, 2024​​Why is gRPC so much faster than a JSON-based REST API? Two primary reasons are HTTP/2 an…
  5. Nov 7, 2024​​AI is changing the world as we know it, and for developers, embracing it can significant…
  6. Oct 28, 2024​​CopilotKit is an open-source framework that makes it easy to integrate powerful, product…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →