Skip to content

Instantly share code, notes, and snippets.

View anandof28's full-sized avatar

Anand Chitravelu anandof28

  • Outbound.Ai
  • Chennai,India
View GitHub Profile
import React, { Component, Fragment } from "react";
import { render } from "react-dom";
import "bootstrap/dist/css/bootstrap.css";
/**
* this.state = {
*
* }
*/
class Review extends Component {
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
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 = {
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 = {
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;
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
},
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}
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>
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.
*/
/**
* Literals and Variable declaration
* Arrow Function
* ES6 Classes , Object destrucing
* Async Programing - Classbacks, Promises
* Modularity - Es6 Modules
*/
/**
* How to declare variable