I'm working on ReactJS project and my requirement is simple. If something went wrong in the project show error message in screen instead of white screen because of the error.
for example:
for(let i=0; i<array.length; i++){
//something here
}
so in this case let suppose array.length is undefined or null etc show in console its show me an error and the code breaks with white screen. All I want is to handle this kind of rendering error issue on runtime so user can understand there is a bug here etc.
Thank you.