Our current web-app is build mostly in JSP with Struts at the back-end, and a bit of JQuery in the front end.
We plan to transition to ReactJS one step at a time. I am aware of ways to incorporate React components into JSP. However, we consider doing it the other way around. So some new pages will be build in React, and some components (header and footer for instance) will be loaded from a dedicated URL build by struts+JSP. This way we can build new clean and organized code build around React, and still use our previous JSP code for certain components.
- Are there any aspects we should consider before going on with this plan?
- How can we add a component in React from an external html source? I this SOF thread which is quite relevant. Acctoding to the thread I should use a method which uses a dangerouslySetInnerHTML property in a component. The property’s name makes me a bit uncomfortable. Is there another method? I guess there is no reason to avoid this method when we know when the HTML code comes from.