jamal-pb95
jamal_uddin95
@jamal.pb95
jamal.pb95
jamal-pb95
# Airbnb
# Alipay
# Wordpress.com source code and
# and many other big bosses using React
this is not a MVC frameworks. React just work with view layer of the MVC pattern.
1. HTML
2. CSS &
3. JavaScript
But the most important thing is: More you learn to React, more deep dive into JavaScript. Because always React try to use update JavaScript features.
1. Modern JavaScript for React Developer
2. Create-React-App and File Structure
3. Hello World with React
4. Introducing JSX
5. Rendering Element
6. Component, Props, State
7. Event Handling
8. React DevTools
9. List, Form and
10. React Hooks
// old school ES5 variable
var name = 'Jamal Uddin'
console.log(name) // Jamal Uddin
// old school ES5 variable
var name = 'Jamal Uddin'
console.log(name) // Jamal Uddin
// ES6
let num = 5
console.log(num) // 5
// old school ES5 variable
var name = 'Jamal Uddin'
console.log(name) // Jamal Uddin
// ES6
let num = 5
console.log(num) // 5
num = 10 // it's possible to change the value
console.log(num) // 10
// old school ES5 variable
var name = 'Jamal Uddin'
console.log(name) // Jamal Uddin
// ES6
let num = 5
console.log(num) // 5
num = 10 // it's possible to change the value
console.log(num) // 10
let num = 11 // SyntaxError: Identifier 'num' has already been declared
// old school ES5 variable
var name = 'Jamal Uddin'
console.log(name) // Jamal Uddin
// ES6
let num = 5
console.log(num) // 5
num = 10 // it's possible to change the value
console.log(num) // 10
let num = 11 // SyntaxError: Identifier 'num' has already been declared
const TAX_RATE = 8.5
console.log(TAX_RATE) // 8.5
const PI = 3.14
console.log(PI) // 3.14
// old school ES5 variable
var name = 'Jamal Uddin'
console.log(name) // Jamal Uddin
// ES6
let num = 5
console.log(num) // 5
num = 10 // it's possible to change the value
console.log(num) // 10
let num = 11 // SyntaxError: Identifier 'num' has already been declared
const TAX_RATE = 8.5
console.log(TAX_RATE) // 8.5
const PI = 3.14
console.log(PI) // 3.14
PI = 3.1416 // TypeError: Assignment to constant variable
// ES5
function greet() {
return 'Hello Friends'
}
// ES5
function greet() {
return 'Hello Friends'
}
// ES6
const greet = () => {
return 'Hello Friends'
}
console.log(greet()) // Hello Friends
// ES5
function greet() {
return 'Hello Friends'
}
// ES6
const greet = () => {
return 'Hello Friends'
}
console.log(greet()) // Hello Friends
// or
const greet2 = () => 'Hello Friends'
console.log(greet2()) // Hello Friends
// ES5
function greet() {
return 'Hello Friends'
}
// ES6
const greet = () => {
return 'Hello Friends'
}
console.log(greet()) // Hello Friends
// or
const greet2 = () => 'Hello Friends'
console.log(greet2()) // Hello Friends
// when you have a single parameter
const greetWithName = (name) => `Hello ${name}`
console.log(greetWithName('Jamal')) // Hello Jamal
// ES5
function greet() {
return 'Hello Friends'
}
// ES6
const greet = () => {
return 'Hello Friends'
}
console.log(greet()) // Hello Friends
// or
const greet2 = () => 'Hello Friends'
console.log(greet2()) // Hello Friends
// when you have a single parameter
const greetWithName = (name) => `Hello ${name}`
console.log(greetWithName('Jamal')) // Hello Jamal
// or
const greetWithName2 = name => `Hello ${name}`
console.log(greetWithName2('Jamal')) // Hello Jamal
// ES5
function greet() {
return 'Hello Friends'
}
// ES6
const greet = () => {
return 'Hello Friends'
}
console.log(greet()) // Hello Friends
// or
const greet2 = () => 'Hello Friends'
console.log(greet2()) // Hello Friends
// when you have a single parameter
const greetWithName = (name) => `Hello ${name}`
console.log(greetWithName('Jamal')) // Hello Jamal
// or
const greetWithName2 = name => `Hello ${name}`
console.log(greetWithName2('Jamal')) // Hello Jamal
// when you have multiple parameters
const multiply = (firstNum, secondNum) => firstNum * secondNum
console.log(multiply(5, 10)) // 50
With JSX:
Without JSX:
import React, { Component } from 'react';
import ReactDOM from 'react-dom'
class App extends Component {
render() {
return (
<div style={{ text-align: center }}>
<h1>Hello Friends</h1>
<p>Thank you for being with us!</p>
</div>
);
}
}
ReactDOM.render(
<App />,
document.getElementById('root');
);
Thank you for being with us!
function Welcome(props) {
return <h1>Hello, {props.name}</h1>;
}
ReactDOM.render(
<Welcome name="Sara" />
document.getElementById('root')
);
class Welcome extends React.Component {
render() {
return <h1>Hello, {this.props.name}</h1>;
}
}
ReactDOM.render(
<Welcome name="Sara" />,
document.getElementById('root')
);
Source: WebJustify
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import './styles.css';
class ClassyCounter extends Component {
state = {
count: 0
};
setCount = () => {
this.setState({ count: this.state.count + 1 });
};
render() {
return (
<div className="counter">
<h1>{this.state.count}</h1>
<button onClick={this.setCount}>Count Up To The Moon</button>
</div>
);
}
}
const rootElement = document.getElementById('root');
ReactDOM.render(<ClassyCounter />, rootElement);
import React, { useState } from 'react';
import ReactDOM from 'react-dom';
import './styles.css';
function HooksCounter() {
const [count, setCount] = useState(0);
return (
<div className="App">
<h1>{count}</h1>
<button onClick={() => setCount(count + 1)}>Count Up To The Moon</button>
</div>
);
}
const rootElement = document.getElementById('root');
ReactDOM.render(<HooksCounter />, rootElement);
https://jaamaal.xyz
jamal-pb95
@jamal_uddin95