Skip to content

Instantly share code, notes, and snippets.

@itsMapleLeaf
Last active January 12, 2023 16:24
Show Gist options
  • Save itsMapleLeaf/e64006dd3f0b0d58c6b0a63cf8fb7617 to your computer and use it in GitHub Desktop.
Save itsMapleLeaf/e64006dd3f0b0d58c6b0a63cf8fb7617 to your computer and use it in GitHub Desktop.
why I still like React

with React, I like being able to describe what my UI should be, top to bottom, depending purely on props and state

with Solid, conceptually, you describe what it starts out as and how it changes over time

in Solid, this manifests as needing to wrap computed values in functions, not being able to destructure props, not being able to use early returns, and so on. I know why it's this way, but it's a tradeoff nonetheless

there's some nice stuff there too though, like how JSX elements are just DOM elements, and there's no need for the "useRef useEffect" dance, and I appreciated that when I tried Solid

all that being said, I still prefer the "start over from scratch on each render" approach, as well as the separation of "UI description" and "imperative bullshit" zones that React gives me. Solid's ecosystem is big enough that I could realistically use it for a project, but ultimately, if rendering was a bottleneck for me, I'd either pick something more React-like, or not use JS/DOM at all 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment