Hacker News new | past | comments | ask | show | jobs | submit login

Funny thing is that recent React fully supports (even recommends) exactly this style for his use case. Stateless component can now be just a function.

https://facebook.github.io/react/blog/2015/10/07/react-v0.14...

He could just change few lines and have JSX, React state management, contexts, property type and all that other stuff available if he ever needs it.

With his own solution he'd eventually need to re-implement bits of React.




Exactly... My first thought seeing his composite is that it isn't much different than react, mercury and others... And imo JSX is easier to reason with.


> Exactly... My first thought seeing his composite is that it isn't much different than react

Yes. And in React composition is not done through string concatenation and values are escaped by default.

I'm not sure about mercury and others but React is first framework I've seen, and I've seen few, that does the composition (from the point of view of react user) exactly the way I'd do it. I had my own framework in PHP (before Rails happened) that did something similar. My components were server side could be composed freely and bundled not just html and js, but also php, css, images ... and could be extended in a way that allowed derived component to override inherited css, images, html, whatever. Flow of information was accidentally unidirectional (thanks to how HTTP works). But the important thing was idea of freely composable components (instead of pages, resources, views, templates, layouts or whatever)


thank you, this is really helpful




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: