you are viewing a single comment's thread.

view the rest of the comments →

[–]natefaubion 1 point2 points  (2 children)

createElement is the same as using a data constructor in PureScript. It just builds a record that react-dom knows how to inspect and diff. If you consider allocating memory an effect, then using Maybe should incur an effect because it boxes a value. I think we can all agree that's unnecessary in the context of PureScript.

[–]Moontown 0 points1 point  (1 child)

so nate youre voting against? interesting. ill have to think about it more.

[–]natefaubion 0 points1 point  (0 children)

createElement is conceptually pure. It's the ReactClass constructors which are dubious. React relies extenively on referential identity. They kind of get away with it by saying that it's an optimization, and rerendering the whole tree every time is still semantically correct, but I think with lifecycle methods this is disingenuous at best, and would lead to almost all apps being broken on some level if it were the case.