DEV Community

Discussion on: Creating a todo app in Elm

Collapse
 
mastoj profile image
Tomas Jansson

Why do you write "They're kind of like React components in many ways, but more specialized and less "reusable" by design."

It shouldn't be to hard to create smaller functions that are reusable.

Collapse
 
selbekk profile image
selbekk

Well, the way I've read the docs so far, it sounds to me like Elm promotes longer files and more repetition than reusable components that are split out. At least at first.

I'm sure you could create reusable components views here as well though, I kind of did with the radio with label view business.

Collapse
 
rickbradford profile image
RickBradford

You can create reusable elements in Elm. But when each element needs to carry its own state, and becomes a component, this begins to clash with the Elm architecture.

As everything in Elm is immutable, you end up having to pass state up and down the line from model to component to sub-component and it quickly becomes complex.