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
I think a nice way would be to make your back end return a error message when there are no records to display.
You could use .catch
after your axios.get().then()
function to see if there are any errors returned by back end and then display it to the user.
Look: What is the proper REST response code for a valid request but an empty data?