Skip to content

Update for "Building a Single Page Application with Cro" (just a detail) #119

@arjancwidlak

Description

@arjancwidlak

Thank you for your great and complete tutorial "Building a Single Page Application with Cro". I'm in the process of following it.

There is an updated needed however, here:
https://cro.services/docs/intro/spa-with-cro#Setting_up_React
Because:

  1. babel-preset-es2015 is deprecated
  2. The automatic installation of peer dependencies was removed with npm 3.

Therefore, update the
npm install --save-dev babel-loader babel-core babel-preset-es2015 babel-preset-react
to:
npm install --save-dev babel-loader core-js@^3 @babel/core@^7 @babel/preset-react

And update the:
{ "presets" : ["es2015","react"] }
to
{ "presets": ["@babel/preset-react"] }
See also here: https://babeljs.io/docs/en/env/

With these changes
npm run build
works.

A bit further, after the text below, the code seems to be missing:

Next up, we'll create a Redux store, which is the thing that holds the latest version of the state produced by the reducer. We create it simply by passing our reducer to createStore:

Probably something like this is needed there: https://redux.js.org/api/createstore

And while I'm on it. I've also a question. Why doesn't the Cro server use the P6W/WAPI standard?

Kind regards,
Arjan.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions