Professional Documents
Culture Documents
ReactJs HandsOn
ReactJs HandsOn
constructor(props){
super(props);
this.state={ count: 1}
handleClick(type){
this.setState(prevState => {
});
render() {
return (
<div>
Count: {this.state.count}
<br/>
</div>
Under Script :
npm install
Hello World :
import React, { Component } from 'react';
render() {
return (
<div>
<h1>Bonjour</h1>
</div>
);
Under Script :
npm install
Props :
Housefull.js
render() {
if(this.props.hasSeat) {
return(
<div>Vacancy</div>
);
} else {
return(
<div>HouseFull</div>);
index.js
Under Script :
npm install jest jest-junit jest-junit-reporter --save react react-dom react-scripts --save-dev jest react-addons-
test-utils enzyme enzyme-adapter-react-16
npm install
Life Event :
constructor(props){
super(props);
this.state={ count: 1}
handleClick(type){
this.setState(prevState => {
});
componentWillMount() {
componentDidMount() {
componentWillUpdate(nextProps, nextState) {
componentDidUpdate(prevProps, prevState) {
render() {
return (
<div>
Count: {this.state.count}
<br/>
</div>
Under Script :
npm install jest jest-junit jest-junit-reporter --save react react-dom react-scripts --save-dev jest react-addons-
test-utils enzyme enzyme-adapter-react-16
npm install