Skip to content

Commit 37ab3c1

Browse files
inital commit
1 parent 9dd1892 commit 37ab3c1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+21800
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

README.md

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,68 @@
1-
# react-app
1+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
2+
3+
## Available Scripts
4+
5+
In the project directory, you can run:
6+
7+
### `npm start`
8+
9+
Runs the app in the development mode.<br>
10+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
11+
12+
The page will reload if you make edits.<br>
13+
You will also see any lint errors in the console.
14+
15+
### `npm test`
16+
17+
Launches the test runner in the interactive watch mode.<br>
18+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
19+
20+
### `npm run build`
21+
22+
Builds the app for production to the `build` folder.<br>
23+
It correctly bundles React in production mode and optimizes the build for the best performance.
24+
25+
The build is minified and the filenames include the hashes.<br>
26+
Your app is ready to be deployed!
27+
28+
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
29+
30+
### `npm run eject`
31+
32+
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
33+
34+
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
35+
36+
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
37+
38+
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
39+
40+
## Learn More
41+
42+
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
43+
44+
To learn React, check out the [React documentation](https://reactjs.org/).
45+
46+
### Code Splitting
47+
48+
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
49+
50+
### Analyzing the Bundle Size
51+
52+
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
53+
54+
### Making a Progressive Web App
55+
56+
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
57+
58+
### Advanced Configuration
59+
60+
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
61+
62+
### Deployment
63+
64+
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
65+
66+
### `npm run build` fails to minify
67+
68+
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

package.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "hello-world",
3+
"version": "0.1.0",
4+
"private": true,
5+
"dependencies": {
6+
"axios": "^0.19.0",
7+
"react": "^16.8.6",
8+
"react-dom": "^16.8.6",
9+
"react-scripts": "3.0.1"
10+
},
11+
"scripts": {
12+
"start": "react-scripts start",
13+
"build": "react-scripts build",
14+
"test": "react-scripts test",
15+
"eject": "react-scripts eject"
16+
},
17+
"eslintConfig": {
18+
"extends": "react-app"
19+
},
20+
"browserslist": {
21+
"production": [
22+
">0.2%",
23+
"not dead",
24+
"not op_mini all"
25+
],
26+
"development": [
27+
"last 1 chrome version",
28+
"last 1 firefox version",
29+
"last 1 safari version"
30+
]
31+
},
32+
"devDependencies": {
33+
"@babel/cli": "^7.5.5",
34+
"@babel/core": "^7.5.5",
35+
"@babel/preset-flow": "^7.0.0",
36+
"flow-bin": "^0.103.0"
37+
}
38+
}

public/favicon.ico

3.78 KB
Binary file not shown.

public/index.html

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<!--
9+
manifest.json provides metadata used when your web app is installed on a
10+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
11+
-->
12+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
13+
<!--
14+
Notice the use of %PUBLIC_URL% in the tags above.
15+
It will be replaced with the URL of the `public` folder during the build.
16+
Only files inside the `public` folder can be referenced from the HTML.
17+
18+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
19+
work correctly both with client-side routing and a non-root public URL.
20+
Learn how to configure a non-root public URL by running `npm run build`.
21+
-->
22+
<title>React App</title>
23+
</head>
24+
<body>
25+
<noscript>You need to enable JavaScript to run this app.</noscript>
26+
<div id="root"></div>
27+
<!--
28+
This HTML file is a template.
29+
If you open it directly in the browser, you will see an empty page.
30+
31+
You can add webfonts, meta tags, or analytics to this file.
32+
The build step will place the bundled scripts into the <body> tag.
33+
34+
To begin the development, run `npm start` or `yarn start`.
35+
To create a production bundle, use `npm run build` or `yarn build`.
36+
-->
37+
</body>
38+
</html>

public/manifest.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"short_name": "React App",
3+
"name": "Create React App Sample",
4+
"icons": [
5+
{
6+
"src": "favicon.ico",
7+
"sizes": "64x64 32x32 24x24 16x16",
8+
"type": "image/x-icon"
9+
}
10+
],
11+
"start_url": ".",
12+
"display": "standalone",
13+
"theme_color": "#000000",
14+
"background_color": "#ffffff"
15+
}

src/App.css

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
.App {
2+
text-align: center;
3+
}
4+
5+
.App-logo {
6+
animation: App-logo-spin infinite 20s linear;
7+
height: 40vmin;
8+
pointer-events: none;
9+
}
10+
11+
.App-header {
12+
background-color: #282c34;
13+
min-height: 100vh;
14+
display: flex;
15+
flex-direction: column;
16+
align-items: center;
17+
justify-content: center;
18+
font-size: calc(10px + 2vmin);
19+
color: white;
20+
}
21+
22+
.App-link {
23+
color: #61dafb;
24+
}
25+
26+
@keyframes App-logo-spin {
27+
from {
28+
transform: rotate(0deg);
29+
}
30+
to {
31+
transform: rotate(360deg);
32+
}
33+
}

src/App.js

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
import React from 'react';
2+
import './App.css';
3+
import { Counter } from './components/Counter';
4+
import { Greet } from './components/Greet';
5+
import { Welcome } from './components/Welcome';
6+
import FunctionClick from './components/FunctionClick';
7+
import ClassClick from './components/ClassClick';
8+
import EventBind from './components/EventBind';
9+
import ParentComponent from './components/ParentComponent';
10+
import UserGreeting from './components/UserGreeting';
11+
import NameList from './components/NameList';
12+
import StyleSheet from "./components/StyleSheet";
13+
import Inline from './components/Inline';
14+
import './components/appStyle.css'
15+
import style from './components/appStyle.module.css'
16+
import Form from './components/Form';
17+
import LifeCycleA from './components/LifeCycleA';
18+
import Table from './components/Table';
19+
import ParentComp from './components/ParentComp';
20+
import RefsDemo from './components/RefsDemo';
21+
import FocusInput from './components/FocusInput';
22+
import FRParentInput from './components/FRParentInput';
23+
import Heros from './components/Heros';
24+
import ErrorBoundry from './components/ErrorBoundry';
25+
import HoverCounter from './components/HoverCounter';
26+
import ClickCounter from './components/ClickCounter';
27+
import CounterTwo from './components/CounterTwo';
28+
import ClickCounterTwo from './components/ClickCounterTwo';
29+
import HoverCounterTwo from './components/HoverCounterTwo';
30+
import { UserProvider } from './components/userContext';
31+
import ComponentC from './components/ComponentC';
32+
import PostList from './components/PostList';
33+
import HookCounter from './components/HookCounter';
34+
35+
// import { Hello } from './components/Hello';
36+
// import { Messages } from './components/Messages';
37+
38+
function App() {
39+
return (
40+
<div className="App">
41+
<HookCounter />
42+
{/* <PostList /> */}
43+
{/* <UserProvider value = 'CodeMyMobile'>
44+
<ComponentC />
45+
</UserProvider> */}
46+
47+
<CounterTwo >
48+
{(count, incrementCount) => (<ClickCounterTwo count={count} incrementCount={incrementCount} />)}
49+
</CounterTwo>
50+
{/* <CounterTwo>
51+
{(count, incrementCount) => (<HoverCounterTwo count={count} incrementCount={incrementCount} />)}
52+
</CounterTwo> */}
53+
{/* <CounterTwo render = {(count, incrementCount) => <ClickCounterTwo count = {count} incrementCount = {incrementCount}/>}/>
54+
<CounterTwo render = {(count, incrementCount) => <HoverCounterTwo count = {count} incrementCount = {incrementCount}/>}/>
55+
<HoverCounter name = 'Pushpendra Kumar' countValue = '1000' />
56+
<ClickCounter name = 'Himanshu' countValue = '1000'/> */}
57+
{/* <ErrorBoundry>
58+
<Heros heroName='SuperMan' />
59+
</ErrorBoundry>
60+
<ErrorBoundry>
61+
<Heros heroName='Batman' />
62+
</ErrorBoundry> */}
63+
{/* <FRParentInput /> */}
64+
{/* <FocusInput /> */}
65+
{/* <RefsDemo /> */}
66+
{/* <ParentComp /> */}
67+
{/* <Table /> */}
68+
{/* <LifeCycleA /> */}
69+
{/* <Form /> */}
70+
{/* <h1 className = 'error'>Error</h1>
71+
<h1 className = {style.success}>Success</h1> */}
72+
{/* <Inline /> */}
73+
{/* <StyleSheet primary = {true} /> */}
74+
{/* <NameList /> */}
75+
{/* <UserGreeting /> */}
76+
{/* <ParentComponent /> */}
77+
{/* <EventBind name = "Pushpendra Kumr"/> */}
78+
{/* <Counter /> */}
79+
{/* <Messages /> */}
80+
{/* <FunctionClick />
81+
<ClassClick /> */}
82+
{/* <Greet name = "Clark!" heroName = "superman"/>
83+
<Welcome name = "Diana" heroName = "batman" /> */}
84+
85+
{/* <Greet name = "Diana!" heroName = "batman">
86+
<p> This is children props</p>
87+
</Greet>
88+
<Greet name = "Mark!" heroName = "shaktiman"/>
89+
<Welcome name = "Clark" heroName = "Superman" />
90+
<Welcome name = "Mark" heroName = "Shaktiman" /> */}
91+
92+
{/* <Hello /> */}
93+
</div>
94+
);
95+
}
96+
97+
export default App;

src/App.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
import ReactDOM from 'react-dom';
3+
import App from './App';
4+
5+
it('renders without crashing', () => {
6+
const div = document.createElement('div');
7+
ReactDOM.render(<App />, div);
8+
ReactDOM.unmountComponentAtNode(div);
9+
});

src/components/ChildComponent.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from 'react'
2+
3+
function ChildComponent(props) {
4+
return (
5+
<div>
6+
<button onClick = {() => props.greetHandler('child')}> Greet methods </button>
7+
</div>
8+
)
9+
}
10+
11+
export default ChildComponent

src/components/ClassClick.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React, { Component } from 'react'
2+
3+
class ClassClick extends Component {
4+
5+
clickhandler() {
6+
console.log('Clicked the button')
7+
}
8+
render() {
9+
return (
10+
<div>
11+
<button onClick = {this.clickhandler}>click me</button>
12+
</div>
13+
)
14+
}
15+
}
16+
17+
export default ClassClick

src/components/ClickCounter.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
import React, { Component } from 'react'
3+
import UpdatedComponent from './withCounter'
4+
5+
class ClickCounter extends Component {
6+
render() {
7+
const { count, incrementCount } = this.props
8+
return (
9+
<div>
10+
<button onClick={this.props.incrementCount}> {this.props.name} clicked {count} </button>
11+
</div>
12+
)
13+
}
14+
}
15+
16+
export default UpdatedComponent(ClickCounter, 10)

src/components/ClickCounterTwo.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React, { Component } from 'react'
2+
3+
class ClickCounterTwo extends Component {
4+
render() {
5+
const { count, incrementCount } = this.props
6+
return (
7+
<div>
8+
<button onClick={incrementCount}> clicked {count} </button>
9+
</div>
10+
)
11+
}
12+
}
13+
14+
export default ClickCounterTwo

src/components/Column.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React from 'react'
2+
3+
export default function Column() {
4+
return (
5+
// <>
6+
// <td> Column 1</td>
7+
// <td> Column 2</td>
8+
// <td> Column 3</td>
9+
// <td> Column 4</td>
10+
// </>
11+
12+
<React.Fragment>
13+
<td> Column 1</td>
14+
<td> Column 2</td>
15+
<td> Column 3</td>
16+
<td> Column 4</td>
17+
</React.Fragment>
18+
)
19+
}
20+
21+
// this is an example of fragment in reactjs

0 commit comments

Comments
 (0)