DEV Community

React newbie having to learn on an AMD project

GaryRoussak on October 21, 2020

Hi, I've been working on the Java back end of my project but having to move over to doing some React enhancements on the UI. I really want to get ...
Collapse
 
nestedsoftware profile image
Nested Software • Edited

It may help to separate concerns. First look at just how to work with amd/requirejs and some plain javascript. Then dig into how older react works with the createClass stuff (nothing to do with amd) - e.g. search for "react createClass vs Component" and you should be able to find some articles that help map between the older and newer react syntax.

Collapse
 
garyroussak profile image
GaryRoussak

@nestedsoftware
Many thanks !

Collapse
 
devwax profile image
Steve Monsen

Possibly try a "transpile to AMD" strategy?

Transpiling CommonJS/ES6 modules to AMD

1

We are running a setup where React components that are written in CommonJS/ES5 on the backend need to be available on the front-end also for React rendering on both server and client.

I am trying to figure out how to transpile the React components from JSX to JS as well…