JavaScript
- Async vs Defer Script Loading, Article
- Var vs Let vs Const, Article
- Strict Equality, Article
- Hoisting
- Scoping
- DOM Traversal
- Closures
- Reference Vs Value
- DOM Manipulation
- Arrow Functions, Article
- Callbacks
- Event Listeners
- Promises
- Async Await
- Fetch
- Browser Storage, Article
- Event Loop
- Modules, Article
- Template Literals
- Array Methods
- Null Vs Undefined
- Recursion
- Short Circuiting
- Ternary Operator, Article
- Destructoring/Spread Operator, Article
- Classes
- Bundlers
React
- Component Model
- JSX
- Events
- Class vs Function Components
- Props
- State, Article
- useEffect, Article
- useLayoutEffect
- Context, Article
- Refs, Article
- useMemo, Article
- useCallback, Article
- useReducer, Article
- Custom Hooks, Article
- PropTypes
- Portal, Article
- Best Practices, Local State Article, Derived State Article, Debounce Article
Project create using only command
- or
npm i -g create-react-app
- Step 1 :
create-react-app react-practice
- Step 2 :
create css folder and added style.css file
- Step 3 :
import style.css & js script
file intopublic > index.html
file - Step 4 :
Create single Component like Skills
Step by Step frontend app creation
yarn init -y
for custom createyarn add parcel-bundler -D
yarn add react react-dom
yarn add prettier
- command on terminal
yarn format
"scripts": { "start": "parcel index.html", "format": "prettier --write app.js" "format": "prettier --write \"src/**/*.{js, jsx}\" }
- move script file into src folder -
"format": "prettier --write \"src/app.js\""
"format": "prettier --write \"src/**/*.{js, jsx}\""
yarn start
yarn add json-server
for running from main project"start": " concurrently \"yarn dev:server\" \"yarn dev:client\"",
for client and server runningyarn add concurrently
help for two command running- if want to port fixed
"dev:server": "yarn --prefix server json-server --watch ./server/db.json -p 8001",
yarn add babel-polyfill
yarn add axios
json server creation
- json server ref : https://github.com/typicode/json-server
- create a server folder
yarn init -y
then generate apackage.json
fileyarn add json-server
json-server --watch db.json
- add script into
package.json
file"scripts": { "dev:server": "json-server --watch db.json" },
- then for run command:
yarn dev:server
- add client
package.json
file"dev:server": "yarn --prefix server json-server --watch ./server/db.json",
- also update
package.json
file"dev:client": "parcel index.html --open",
- then for run command:
Eslint configure
-
yarn add eslint -D
-
yarn eslint
-
yarn eslint --init
chooseTo check syntax and find problems
thenJavascript modules (import/export)
thenReact
browser node
JSON
eslint-plugin-react@latest
install yes -
if problem to install manually then run command into terminal
yarn add eslint-plugin-react -D
-
add
package.json
file into script"lint": "eslint \"src/**/*.{js,jsx}\""
-
check eslint
yarn lint
-
yarn add eslint-plugin-jsx-a11y -D
(https://www.npmjs.com/package/eslint-plugin-jsx-a11y) -
yarn add eslint-plugin-import -D
(https://www.npmjs.com/package/eslint-plugin-import) -
yarn add eslint-config-prettier - D
(https://www.npmjs.com/package/eslint-config-prettier) -
for warning remove for eslint into
.eslintrc.json
file"extends": [ "eslint:recommended", "plugin: import/errors", "plugin:react/recommended" ], "plugins": [ "react", "import", "jsx-a11y" ], "settings": { "react": { "version": "detect" }
Reference
- Validator - https://www.npmjs.com/package/validator
- UUID - https://www.npmjs.com/package/uuid
- React router dom - https://www.npmjs.com/package/react-router-dom
- fetch api : https://javascript.info/fetch
- babel polyfill - https://github.com/babel/babel/tree/master/packages/babel-polyfill (regenerator-runtime issue)
- Axios : https://www.npmjs.com/package/axios
Project create using only command
This project was bootstrapped with Create React App.
Available Scripts
In the project directory, you can run:
yarn start
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
yarn test
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
yarn build
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
yarn eject
Note: this is a one-way operation. Once you eject
, you can’t go back!
If you aren’t satisfied with the build tool and configuration choices, you can eject
at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject
will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use eject
. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
Learn More
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
Code Splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
Analyzing the Bundle Size
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
Making a Progressive Web App
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
Advanced Configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
Deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
yarn build
fails to minify
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify