Conversation
|
Well done! A React user could get up and going in 5 minutes from that. As a React user, I have a few follow-ups that still aren't clear. Components have been a bit of a blocker so far for me, although I've been struggling a bit with nanocomponent. Although this sounds like it's still a WIP so maybe that needs to be sorted out. The next is that I don't understand the difference in the diffing model that React and choo use. This has led to many bugs and confusing moments for me. Finally forms, are mysterious to me. React has the concept of controlled components for forms, and I haven't seen a mapping of this concept. I've also had choo obliterate the contents of my forms while diffing. |
|
@gregtatum sick! - will do! |
|
|
||
| ## Declarative Rendering | ||
| Both React and Choo have a system that allows you to define of "this is what the | ||
| DOM should look like". React uses JSX, and Choo uses Template String Literals. |
There was a problem hiding this comment.
React uses JSX
This is a huge difference, and the main reason why I've never wanted to try React. Should we talk a bit more about the non-standard jsx? I mean how it forces you to use some specific environment config. Choo on the other side expect native DOM, we could even replace choo/html and use any other DOM library. IMO, this difference is huge.
There was a problem hiding this comment.
Yes, although I don't think this guide should serve as a list of things that Choo has over React :P
| #### Choo | ||
| ```js | ||
| var tree = html` | ||
| <button onclick={onclick}> |
There was a problem hiding this comment.
should be onclick=${onclick} since this are template strings literals
|
|
||
| However, there are a good amount of differences. At its core Choo is | ||
| "declarative rendering" + "shared event emitter" + "router". Once you understand | ||
| how these pieces fit together, you'll quickly be able to create an intuition for |
There was a problem hiding this comment.
"create an intuition for" -> "understand"
|
|
||
| ## Declarative Rendering | ||
| Both React and Choo have a system that allows you to define of "this is what the | ||
| DOM should look like". React uses JSX, and Choo uses Template String Literals. |
There was a problem hiding this comment.
Yes, although I don't think this guide should serve as a list of things that Choo has over React :P
| </body> | ||
| ` | ||
| } | ||
| ``` |
WIP