Hacker News new | ask | show | jobs
by ______-_-______ 1572 days ago
Solid's <For> doesn't rely on any build-time magic, other than the JSX custom function call syntax that is also present in React. If you want, you can even call it like an ordinary function:

    function MyComponent() {
        return For({
            each: [1,2,3,4],
            children: x => <div>{x}</div>,
        })
    )
It's just a function call, and it doesn't even need `React.createElement`. What's more pure than that?
1 comments

Normal for statement is more pure than that.
Functional purity? `for` can only have side effects. It has no functional purity. It doesn't even have a value.
Imperative purity.