This is so much better than React or svelte, no state management, built-in tailwind and more concise and expressive!
This is so much better than React or svelte, no state management, built-in tailwind and more concise and expressive!
let count = 0
tag Counter
<self @click=(count++)> "Count is: {count}"
imba.mount <Counter>, document.bodyIf it’s just using global variable for state then it will be shared between component. You can do the same thing in React, it’s just a bad idea.
If it does some magic under the hood to convert regular variables into something different like Svelte pre-5.0 (which Svelte decided to make more explicit in 5.0), then could you point me to docs describing it, I’m curious which approach they took with this.
tag App
counter = 0
<self>
<button @click=counter++> "{counter}"
imba.mount <App>it doesn't have to be anything. You're free to organize your code as you wish: colocate, in a different file ... the compiler doesn't transform the variable in any way, nor does it track its "mutation", it "just" "rerenders" on every change. And it's super fast too!
tag Counter
count = 0
<self @click=(count++)> "count: {count}"