You need to define a type for the state property in order to use it.
class ComponentA extends Component {
state: {
isExpanded: Boolean
};
constructor(props) {
super(props);
this.state = {
isExpanded: false
};
}
}