score:0

 render() {
      return (
           this.state.isLoader ?(<Loading />) : <YourComponent/>
    )}

score:2

searchData = () => {
  // Start the loader
  this.setState({
    visibility: true,
  });

  //  ....Your logic goes here

  // Stop the loader
  this.setState({
    visibility: false,
  });
};

Related Query

More Query from same tag