State
State is similar to props, but it is private and fully controlled by the component.
link - channel9.msdn.com/Shows/Web-Wednesday/How-do-I-work-with-state-in-React
interface IState_BETClass {
sItems: IListItem[]
}
States should only be used attributes that need to change
A parent can pass in props to set the default values for the state during construction.
State is a feature only available in classes.
constructor(props) {
super(props);
this.state = {date: new Date()};
}
© 2023 Better Solutions Limited. All Rights Reserved. © 2023 Better Solutions Limited TopPrevNext