State is similar to props, but it is private and fully controlled by the component.
link -

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) { 
    this.state = {date: new Date()};

© 2023 Better Solutions Limited. All Rights Reserved. © 2023 Better Solutions Limited TopPrevNext