Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Hooks have some intriguing properties, but they also involve some unnatural code and create unnecessary work for the garbage collector.

Thank you for pointing this out. To me hooks were always a way to solve problems in React that wouldn't be there if it weren't for React. They help, but come at a cost which barely anybody seems to talk about.

We really want to add first-class TypeScript support.

Yes, please!



I've created two project as a POC for typescript support https://github.com/farhan2106/svelte-typescript https://github.com/farhan2106/svelte-typescript-ssr

Basically, I separate out the <script> & <html> section into two files. The <script> part is generated from typescript and combined later before sending it into the svelte compiler.

I am currently working on a gulp build file to streamline the process.

Let me know what you think.


Hooks solve a definite problem that I’m not sure is limited to React, but at the end of the day they feel too much like magic to me.

Reasoning about hooks is hard.


I find this interesting. Could you give an example of a case you find hard to reason about?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: