3 ms·
So JavaScript dom manipulations are pure? but one specific technique of dom manipulations are not?
by debaserab2 9y ago
So JavaScript dom manipulations are pure? but one specific technique of dom manipulations are not?
- LeoNatan25 9y agoIt'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.
- debaserab2 9y agoReact has zero dependencies to use it, actually. https://github.com/facebook/react/blob/master/package.json https://github.com/facebook/react/blob/master/package.json
- RobertRoberts 9y agoCan you use react without Node or NPM or a compiler/transpiler or build tool?
- debaserab2 9y agoOf 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)
- RobertRoberts 9y agoI'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?
- debaserab2 9y agoI 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)