Skip to content

Instantly share code, notes, and snippets.

@Crydust
Last active May 15, 2023 12:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Crydust/ec2dcaaa7121876cfea9eae0b1858e89 to your computer and use it in GitHub Desktop.
Save Crydust/ec2dcaaa7121876cfea9eae0b1858e89 to your computer and use it in GitHub Desktop.
React

React

References

https://developer.fedoraproject.org/tech/languages/nodejs/nodejs.html https://developer.fedoraproject.org/tech/languages/nodejs/modules.html

Install nodejs

$ sudo dnf install nodejs

Installing Global Modules

$ mkdir ~/.npm-global
$ mkdir ~/.npm-global/lib
$ npm config set prefix '~/.npm-global'

Open/create the ~/.profile file and add the following line: export PATH="$PATH:~/.npm-global/bin"

$ source ~/.profile

mdn : Getting started with React

$ npx create-react-app moz-todo-react
$ idea moz-todo-react
$ npm install nanoid

Alternative: use Vite

https://vitejs.dev/guide/

$ npm create vite@latest moz-todo-react --template react
$ npm run dev

Connect to an api

npm install -g openapi-generator-cli
npx openapi-generator-cli generate -i http://localhost:8080/v3/api-docs -o out -g typescript-fetch --additional-properties=supportsES6=true,npmName=todo-client
cd out
npm install
npm run build
copy the "dist/esm" into "src/generated"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment