DEV Community

Discussion on: Is Angular Dead in 2022?

 
kresli profile image
Eduard Jacko • Edited

@mellunar The React example is not a valid component ;) Maybe you should write an actual simple component as you are pointing to difference between state management only. This is more fair to compare

<script>
    let name = 'world';
</script>
<h1>Hello {name}!</h1>
<button on:click={() => name = "Hi"}>click me</button>
Enter fullscreen mode Exit fullscreen mode

vs



function Greeting() {
  const [state, setState] = useState("world")
  return (
      <>
          <h1>Hello  {state}!</h1>
          <button onClick={() => setState("Hi")}>click me</button>
      </>
  )
}
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
ivan_jrmc profile image
Ivan Jeremic • Edited

A javascript function body is your script tag in Svelte the javascript return is your svelte file for markup, some people like programming some like XML style.

Thread Thread
 
sarcevicantonio profile image
Antonio Sarcevic • Edited

Implying writing HTML isn't programming

Thread Thread
 
ivan_jrmc profile image
Ivan Jeremic

Writing jsx is.

Thread Thread
 
sarcevicantonio profile image
Antonio Sarcevic

Im glad you feel superior for making your life harder 🤣

Thread Thread
 
ivan_jrmc profile image
Ivan Jeremic

I'm sorry for you that your brain can't grasp it.

Some comments have been hidden by the post's author - find out more