An example of using skit with React by preprocessing .jsx files and handling server-side prerendering of react components transparently.
main.js
defines a custom .jsx resource loader for React, so you need to run main.js
like so:
git clone https://github.com/taylorhughes/skit-react.git
cd skit-react
npm install
node main.js
(the skit run
command does not know where to get the custom loaders; there is no standard place to put them yet.)
- main.js sets up .jsx preprocessing and injects the react runtime dependency;
- root/library/BaseController.jsx handles the React -> string -> DOM -> react lifecycle;
- and root/public/Home.jsx is the page at http://localhost:3001/ if you run the demo. Home inherits from BaseController so it gets the React serialization/reinstantiation from it.