Hacker News new | ask | show | jobs
by madeofpalk 2312 days ago
Some of the benefits of "React" don't come from React itself, but rather the ecosystem. Webpack, Typescript, CSS Modules, etc are all things that work well in the "react ecosystem". Certainly possible outside of that, but its going to be harder.

Do you get type safety in Handlebars?

1 comments

Correct AFAIK you can't get end to end type safety in Handlebars, in that if you treat a string as an array it will silently not render something, whereas in Typescript / React you would notice.

But... let's forget Handlebars because Typescript/ES6 allows you to write code like this:

    mythings.map(thing = `<li>${thing.name}</li>`).join();
And this is React-free and arguably a lot simpler for the needs of a static site, and actually more flexible as your are controlling the character by character output.

And the question is do I want to pull in not just React but Next.js and learn all of it's ways to do this? I think for a static site no.