Hacker News new | past | comments | ask | show | jobs | submit login

So JavaScript dom manipulations are pure? but one specific technique of dom manipulations are not?



It's not specifically the DOM modification but the way those frameworks are designed. With React you have hundreds of dependencies, which have hundreds of dependencies. You lost me right there.


React has zero dependencies to use it, actually.

https://github.com/facebook/react/blob/master/package.json


Can you use react without Node or NPM or a compiler/transpiler or build tool?


Of course - just pop it in a script tag and use the React object functions to render your DOM (which is exactly what transpiled code does)


I've looked into Vue.js, and they seem to indicate that it's easier to get up an running than react (using what you describe here). Are you suggesting vue.js and react work exactly the same?


I don't know because I don't use Vue. What you'd be missing if you dropped in the react library and did no compilation at all is the ability to use JSX. I'm guessing vue's argument is their attribute tags still work in their minimal deployment whereas with React you'd be manually wiring up things to the React object functions.

So, with React, instead of:

    return <div>My component!</div>
You use:

    return React.createElement('div', {}, 'My component!);
Some people like the more implicit style anyways (although I don't and I don't know anybody who does at this point)




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: