I have a question about how to use React without Nodejs. I know there is a CDN link that we can use React like a normal script. But what I want is be able to import React like a module (es6) without Nodejs
From React source code I see import statement like this:
import ReactVersion from 'shared/ReactVersion';
But I think it only work with Nodejs, right? Because from what I know, es6 import statement requires to ".js" to be added
Is it possible? Do you have any idea?
Thanks for your help
You don't need nodejs to es6 syntax. If you are using es6 syntax then due to compatibility reason you need to transpile to es5. To do that you need some bundler like web pack or parcel. They can transpile your code to es5.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With