2 ms·
Oh I gotcha! That quote applies to react as well though (I've done it many times!). I suppose I could rephrase my question to something like "What is the point
by kingdomcome50 6y ago
Oh I gotcha! That quote applies to react as well though (I've done it many times!).
I suppose I could rephrase my question to something like "What is the point of this library?". Every other page on that site that includes examples uses JSX... which means there needs to be a build step.
I guess if someone really just wants to include a 3rd party library to programatically create elements, but get none of the benefits of using them this would be great! Then again there is like 3 examples in this thread of tiny functions (< 10 LoC) that appear to do the same thing.
I guess 3.5kb is about 10x smaller than React + React DOM, but 35kb isn't exactly breaking the bank either. I can't tell specifically by glancing over their examples, but I also suspect feature parity is not quite there. Specifically, I develop with Typescript so being able to type hint `React.ChangeEvent<HTMLInputElement>` etc. is sometimes necessary. It's not clear if Preact exposes a sufficient API. Maybe you know?
- bschwindHN 6y ago> I suppose I could rephrase my question to something like "What is the point of this library?" It's just a lightweight, no-build-steps-required library that's similar to React. If you already like using React there's nothing much compelling to make you switch. I like using it with HTM for a nice alternative to JSX which doesn't need any build steps. I can't speak on its interaction with TypeScript, I've only used this for simple pages where I want to add some interactivity without involving the rest of the nightmarish JS ecosystem. https://github.com/developit/htm https://github.com/developit/htm