RM
I like Svelte but that code comparison is kinda staged. A fair one would use hooks on React, also would properly clear the interval in Svelte too and used the component created inside other component as well. For React can be done this way (and clearing the interval): function Timer ( ) { const [seconds, setSeconds] = useState( 0 ); useEffect( () => { const interval = setInterval ( () => { setSeconds(seconds + 1 ); }, 1000 ); return () => clearInterval (interval); }); return < span > Seconds: {seconds} </ span > ; } Either way, Svelte is really nice and I'd recommend it every day.