when I click button, "isLoading" set to true and loading gif seems in page, process simple here its click function;
private clickFunction(e): void {
this.state.isLoading=true; ..
so i expect this loading gif seems in page;
<div style={{"display":this.state.isLoading?"block":"none"}}><i className="fa fa-spinner fa-spin"></i></div>
but its not working.. whats wrong here? since if initial value of isLoading property set as true, gif seems on plageload so whats I think state not updating the render or ?
EDITED :
When I try to update only one property of state ts compiler throws this exception;
Whats worng with here ?
export interface IWebPartState {
status: string;
Name: string;
isLoading:boolean;
}
export default class Contact extends React.Component<IContactProperties, IWebPartState> { ...
this.state.isLoading=trueis wrong. instead usesetState