News for hackers. Stuff that matters.
Re:Comparing Svelte and React by dhucerbin on Wednesday March 24, 2021 @06:11PM (#26573670)
I assume you don’t like invocation? That’s not the point here. In svelte you can’t* define type variable that’s bound to the same type in whole component. I can’t enforce that properties `items` is `T[]` and `selectedItem` is `T`.

* Last time I checked. I could be wrong now.

Re:Comparing Svelte and React by patwoz on Thursday March 25, 2021 @03:27AM (#26577337)
I'm writing about <MenuSelect<User users={..} /> and not about Svelte. I don't know anything about Svelte except what I just learned in the article. I just don't like the syntax of <MenuSelect<User> /> and favour <MenuSelect /> instead, because Typescript will inherit it's generic type from users={...}

See my example here: https://codesandbox.io/s/clever-neumann-89tnx?file=/src/App....