I am working on project in ReactJS, I am fetching data from server through API. I did some search filtration, I want to display message if there is no records available? I a
You can make use of conditional rendering!
render(){ const filteredItems = this.getDataItems(this.state.filtered); const dataItems = this.getDataItems(this.state.data); if(dataItems){ return( Your Message ) } else{ //Your normal code } }