This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component, Fragment } from "react"; | |
| import { render } from "react-dom"; | |
| import "bootstrap/dist/css/bootstrap.css"; | |
| /** | |
| * this.state = { | |
| * | |
| * } | |
| */ | |
| class Review extends Component { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| import { render } from "react-dom"; | |
| import "bootstrap/dist/css/bootstrap.css"; | |
| /** | |
| * State | |
| * -> Another way to represent data in react | |
| * -> It is ment for biz logic | |
| * -> State is maintained, changed by a component itself | |
| * -> State is Changed by biz logic |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component, Fragment } from "react"; | |
| import { render } from "react-dom"; | |
| import "bootstrap/dist/css/bootstrap.css"; | |
| /** | |
| * Context | |
| */ | |
| //Without context : how to pass theme to child components via props | |
| /* class App extends Component { | |
| theme = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component, Fragment } from "react"; | |
| import { render } from "react-dom"; | |
| import "bootstrap/dist/css/bootstrap.css"; | |
| /** | |
| * Context | |
| */ | |
| //Without context : how to pass theme to child components via props | |
| class App extends Component { | |
| theme = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| import { render } from "react-dom"; | |
| import "bootstrap/dist/css/bootstrap.css"; | |
| const Account = props => { | |
| //update new balance; | |
| /** | |
| * TypeError: Cannot assign to read only property 'balance' of object '#<Object>' | |
| */ | |
| // props.balance = 8000; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| import { render } from "react-dom"; | |
| import "bootstrap/dist/css/bootstrap.css"; | |
| const Exchange = prop =>{ | |
| const data = [ | |
| { | |
| "exchange_name" : "BSE", | |
| "index" : 2323.78 | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| import { render } from "react-dom"; | |
| import "bootstrap/dist/css/bootstrap.css"; | |
| const DashBoard = prop => { | |
| return ( | |
| <div> | |
| {/* <ProfileContainer | |
| name={prop.name} | |
| city={prop.city} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| import { render } from "react-dom"; | |
| import "bootstrap/dist/css/bootstrap.css"; | |
| import PropTypes from "prop-types"; | |
| const Payment = prop => { | |
| return ( | |
| <div> | |
| <h1>Payment Component</h1> | |
| <p>Payment method : {prop.mode}</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| import { render } from "react-dom"; | |
| import "bootstrap/dist/css/bootstrap.css"; | |
| //Function component and props | |
| /** | |
| * | |
| * in Functional component prop is available as function arg. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Literals and Variable declaration | |
| * Arrow Function | |
| * ES6 Classes , Object destrucing | |
| * Async Programing - Classbacks, Promises | |
| * Modularity - Es6 Modules | |
| */ | |
| /** | |
| * How to declare variable |