state and props
What is the Props
Props is short for properties and they are used to pass data between React components. React’s data flow between components is uni-directional
wt is State
which allows components to create and manage their own data
state and props
What is the Props
Props is short for properties and they are used to pass data between React components. React’s data flow between components is uni-directional
wt is State
which allows components to create and manage their own data
State on React class Component
class Example extends React.Component {
constructor(props) {
super(props);
this.state = {
count: 0
};
}
render() {
return (
<div>
<p>You clicked {this.state.count} times</p>
<button onClick={() => this.setState({ count: this.state.count + 1 })}>
Click me
</button>
</div>
);
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us