Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use React.js on the client side only with my traditional stack

Tags:

jquery

reactjs

I've got a web application. It's got a very traditional technology stack. The server side is Apache Struts, the database is db2 and on the client side I am using JQuery. The application is deployed over websphere.

Recently I have started to use JQuery heavily on a number of pages and I have slowly started to see the JQuery code behind certain pages turn into spaghetti code.

I am looking to use some of the newer javascript frameworks to give the client side JQuery more structure. Unfortunately I am tied to the server side technologies I am using.

I have been reading lately about React.js but I am a bit confused about whether this technology is meant to be server side or client side.

Can I keep my server side technologies and use React.js to give my client side JQuery code more structure?

Also I believe there is some built in capability in React.js to build a mobile application. Could I make that work if I use my current server side technologies and add React.js to only my client side (if that's possible).

thanks

like image 533
Richie Avatar asked Oct 19 '22 00:10

Richie


1 Answers

Yes, this works fine--React simply renders components, you can use it with any server rendering technology you want to. You can also utilize it along many other client-side data libraries to build more complex things.

However, one thing React is not quite as good at is progressive enhancement, which traditionally jQuery has been pretty good at. React expects to be able to completely control a piece of the DOM, so rendering something and then "enhancing" it with React isn't as easily done.

like image 67
Michelle Tilley Avatar answered Oct 21 '22 15:10

Michelle Tilley