7

Tried spending some time researching this but the docs on keystone.js are a little light on this. Googling leads me to some github discussions on implementing React in core Keystone and creating an option in the generator but that work doesn't seem ready yet.

So I think the only option is to manually set a Keystone project as React but I don't have enough info to start down that path. How would I go about using a custom template in Keystone using React?

Qix - MONICA WAS MISTREATED
  • 14,451
  • 16
  • 82
  • 145
o_O
  • 5,527
  • 12
  • 52
  • 90
  • 1
    looks like there's a yeoman generator for using react in keystone, does that help? https://github.com/keystonejs/generator-keystone-react (as far as custom templates go, everything in `app/templates` is editable) – bryce Dec 14 '16 at 20:36
  • I saw that but it doesn't seem to be what I was expecting. It doesn't have the same generator as the regular application so it doesn't create the modules I wanted to test out like the dashboard features, blog, etc. Basically this loads a hello world and what's more, the template files are still written in jade. I guess I don't understand what this generator is doing. – o_O Dec 14 '16 at 21:54
  • If you're still looking, I've just started migrating from a handlebars generated project to react using https://github.com/laurenskling/keystone-with-react-engine it's based on the latest yo keystone generator so may make your life easier. I'm finding it relatively straightforward to move my existing .hbs files to .jsx. – bitfidget Apr 28 '17 at 02:25
  • 1
    if you are still looking for a solution,here is a series of tutorials on this. [https://itnext.io/building-a-node-cms-with-keystonejs-mongo-db-react-and-redux-part-i-ae5958496df2](https://itnext.io/building-a-node-cms-with-keystonejs-mongo-db-react-and-redux-part-i-ae5958496df2) This tutorials has steps to setup your keystone cms from scratch using keystonejs, react and redux. – AviX Apr 04 '18 at 11:44

1 Answers1

0
  1. To create a new Keystone application with React, run the following commands on your terminal:

    • npm init keystone-app my-app
    • Go to the folder and run npm install underscore --save
  2. Then create your queries and mutation in grapgQL.

  3. Fetch the data in react with apollo-client or axios

There is a three part tutorial about this:

part1

part2

part3

pradosh nair
  • 913
  • 1
  • 16
  • 28