- Hooks are a new addition to React 16.8.
- They let you use state and other React features without writing a class.
- What does useEffect do? By using this Hook, you tell React that your component needs to do something after render.
- React will remember the function you passed (we’ll refer to it as our “effect”), and call it later after performing the DOM updates.
- Hooks only works in the functional components. so if you want to use useEffect or any other hook you have to use functional components.
- use effect keeps calling itself if you specifically do not specify an empty array at the end of the useEffect.
Thursday, 24 June 2021
How to setup a New node project?
- Go to your /server directory.
- create index.js ( Our server will run here. )
- You can install dependencies like express, body-parser, Mysql, nodemon
Setup a Nodemon.
- Add these 2 lines under the script tag
- npm run devStart
Wednesday, 23 June 2021
How to upload the existing folder on GitHub Or GitLab?
These are the steps to upload the existing folder on GitHub Or GitLab.
Whenever you want to push your existing folder to git or GitHub you must:-
- Initialize your folder with git init.
- You must have to add origin to push or pull.
( git remote add origin https://github.com/more03625/chat-app-frontend.git ) git branch -M main ( Create branch on git )git add .git push origin main
Error
- error: failed to push some refs to 'https://github.com/more03625/react-bootstrap-crud-app.git'
- The branch is not present on GitHub or on local
- error: failed to push some refs to 'https://github.com/more03625/dsa-cracker.git' Make sure you are pushing to the right branch or is there any typo. check out your current working branch name with this command.
Saturday, 19 June 2021
Create Login Form with React in Hindi | Handling Basic Form with React Hook
import React, {useState} from 'react';
const Basicform = () => {
Friday, 18 June 2021
Difference between Class components & Functional Components in react.js
We are going to create 2 components
class component
functional component
Ref: https://www.geeksforgeeks.org/differences-between-functional-components-and-class-components-in-react
ref2: https://www.youtube.com/watch?v=uGgPINlKqBs
The main & the key difference is
1) When we use Functional components we have to use props. BUT inside the class component, we automatically have that property & we can access that using `this.prop.age`You can pass props in both components. But in functional components, you have to use the `props` keyword & in-class component you automatically have the refernece
Userclass.js
Userfunction.js
We have to use the `props` keyword only in the functional component ONLY. in class components you will have reference automatically. and you can use that using `this.props.title`
Index.js We passed title like this
You can pass props to both functional and class components
- props.children
- props.age
Thursday, 17 June 2021
How to test Newly Created website?
React.js Completed Videos
9) Understanding React Fragment in React JS in Hindi in 2020 #8
10) JSX challenge completed
11) JavaScript Expressions in JSX in ReactJs in Hindi in 2020 #10
12) ES6 Template Literals in JSX in ReactJS in Hindi #11
13) React JS Challenge #2: Display Current Date and Time in JSX in React JS in Hindi #12
14) HTML Attributes vs. JSX Attributes
15) CSS Styling & Importing CSS Files in React JS | Class Vs ClassName in React JS in Hindi in 2020 #14 ( ClassName introduced )
16) How to use Google fonts in React JS Application in Hindi in 2020 #15
17) Internal CSS & Inline CSS Styling In React JS in Hindi in 2020 #16 (Why inline styling);
18) React Components in Hindi | Functional Component in React JS Hindi in 2020 #18
19) React JS Practice #4: Rewrite our React Project into Components in React JS in Hindi in 2020 #19
- We write all the code in App.js & just export App.js in add the app component in Index.js.
- Index.js will be clean code.
20) ES6 Modules Import Export in React JS in Hindi #20
21) React JS Challenge #5: Create Simple Calculator App in React JS in Hindi #21
22) #22: Props in React Js in Hindi | React JS Project Netflix App Part #1 in Hindi in 2020
23) JavaScript Tutorial in Hindi #12: Array in JavaScript in Hindi
24) #23: Arrays in React JS in Hindi | ReactJS Project Netflix App #2 in Hindi in 2020
25)#24 Completing React JS Netflix App #3 | Array Map & Fat Arrow function in React Js in Hindi in 2020
26) ReactJS JavaScript Array Map Method in Hindi with Example