Use React Js With Existing Java Web Application
I am planning to use react js as V (from MVC) in my existing java web based application.
My concern is how do i run react js component on java web application server.
React js uses Node js components. And it has WebPack server which bundles code to single js file(bundle.js).
So May i directly use bundle.js(By copy and paste) to my existing application?
Or i need something else ?
Please suggest.
Thanks.
Answer
React is frontent technology. It work even from CDN. Node.js is backend technology, but it is also use as a tool to build your app. But after you built it then it is no more in use (until you make some changes)
What you have to do:
- Install nodejs and npm.
- Create your react app
- Use nodejs/webpack to build bundle
Now your bundle don't need node.js or webpack. It is normal js file. YOu can use it as you wish.
You can copy your bundle.js file to server where node.js is not installed and you use it in normal way and it will work.
Related Questions
- → How to update data attribute on Ajax complete
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → Octobercms Component Unique id (Twig & Javascript)
- → Passing a JS var from AJAX response to Twig
- → Laravel {!! Form::open() !!} doesn't work within AngularJS
- → DropzoneJS & Laravel - Output form validation errors
- → Import statement and Babel
- → Uncaught TypeError: Cannot read property '__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' of undefined
- → React-router: Passing props to children
- → ListView.DataSource looping data for React Native
- → Can't test submit handler in React component
- → React + Flux - How to avoid global variable
- → Webpack, React & Babel, not rendering DOM