Replies: 4 comments 3 replies
-
Recommended by whom, wielding what authority over our framework and for what reason? Can you provide any source? In any case, it's not mandatory to use them, they just make the code more readable than the alternatives. |
Beta Was this translation helpful? Give feedback.
-
Sorry, maybe my expression is wrong. I mean, the official should provide as few of these non-language standard components as possible. The charm of React compared to other front-end frameworks is that it is closer to language standards. The Solid.js style is as close to React as possible, which is great. And these non-language standard components make the writing style close to vue, and the application looks simple on the surface. But it takes extra memory, from my experience. I don't want to use a different framework to additionally memorize more stuff. This is very bad. |
Beta Was this translation helpful? Give feedback.
-
So your argument comes down to "it's not how I think it should be". Unfortunately, the way you suppose things to work could break reactivity in Solid.js, since mapping an array is basically destructuring it. While you could still use mapArray or mapIndex to the same effect, it's easy to forget, thus we suggest the control flow components, because they are different enough not to trigger react reflexes. |
Beta Was this translation helpful? Give feedback.
-
No, I don't want to break the Solid.js mind. I very much agree with the many features of Solid.js in terms of ease of use. Just a discussion, is it better to be closer to the javascript language itself? E.g: <For each={state.list} fallback={<div>Loading...</div>}>
{(item) => <div>{item}</div>}
</For> Change to pure function(schematic code) {
solidFor(state.list).each((item,index)=>{
return <div>{item}</div>
}).fallback(err => {
return <div>{err.message}</div>
})
} or better purely functional way |
Beta Was this translation helpful? Give feedback.
-
It is recommended to remove all control flow components and do it as a pure function wrapper.
Officials should not provide these non-language standard custom components.
Beta Was this translation helpful? Give feedback.
All reactions