Skip to content

Instantly share code, notes, and snippets.

View saigowthamr's full-sized avatar
🐢
I may be slow to respond.

Sai gowtham saigowthamr

🐢
I may be slow to respond.
View GitHub Profile
import React, { Component } from "react";
import logo from "./logo.svg";
import "./App.css";
function Counter(props) {
return (
<h1>{props.value} 💪</h1>
);
}
class App extends Component {
import React, { Component } from "react";
import logo from "./logo.svg";
import "./App.css";
import NumberContext from "./context";
function Counter(props) {
return (
//by using consumer we are using value in our component.
// we need to use a function to get our value
<NumberContext.Consumer>{val => <h1>{val} 💪</h1>}</NumberContext.Consumer>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>React</title>
</head>
<body>
<div class="connect">
{
"name": "reactscratch",
"version": "1.0.0",
"description": "Create react app from scratch",
"keywords": [
"react-app","scratch"
],
"main": "index.js",
"scripts": {
"watch": "webpack --watch",
const webpack = require('webpack');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
module.exports={
devServer: {
contentBase: path.join(__dirname, "dist"),
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>React from scratch</title>
</head>
<body>
import React, { Component } from "react";
class App extends Component {
render() {
return (
<div style={{ textAlign: "center", marginTop: "10rem" }}>
<h1>App is there</h1>
<p>
What is Lorem Ipsum?
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
import Loading from '../components/Loading';
import Loadable from 'react-loadable';
export const App=Loadable({
loader:()=>import('../components/App'),
loading:Loading
})
export const Posts =Loadable({
import React from "react";
import { Route } from "react-router-dom";
import Header from "../header";
import {App,Posts} from './lazy'
class ReactRouter extends React.Component {
render() {