Create App React Frontend - iff133/first GitHub Wiki
yarn create react-app appcd app/yarn start- go to port 3000 - the app should be running
https://create-react-app.dev/docs/getting-started/
yarn add [email protected] [email protected] @carbon/[email protected] [email protected]yarn add [email protected] [email protected] @carbon/[email protected] [email protected]yarn add @carbon/typeyarn add [email protected]yarn add react-reduxyarn add react-router-domyarn add identity-obj-proxyyarn add @reduxjs/toolkityarn add @testing-library/react- run
yarn install
https://jestjs.io/docs/getting-started
yarn add --dev jest- Generate a basic configuration file:
jest --init - Running from command line:
yarn jest --notify --config ./jest.config.js - Additional Configuration:
-
Using Babel:
-
yarn add --dev babel-jest @babel/core @babel/preset-env -
Configure Babel to target your current version of Node by creating a
babel.config.jsfile in the root of your project:module.exports = { presets: [ ["@babel/preset-env", { targets: { node: "current" } }], "@babel/preset-react", ], };
-
-
Using Babel:
When installing some of the yarn dependencies an error kept showing up: node engine requires v>=12 but got v>=10.0.8 which prevented installations of these packages. In order to fix this the node js engine had to be updated.
I followed Option 2 here: https://phoenixnap.com/kb/update-node-js-version
-
First, clear the npm cache:
sudo npm cache clean -f
-
Install n, Node’s version manager:
sudo npm install -g n
-
Install the latest stable version:
sudo n stable
- Run:
PATH="$PATH"