I would like to gracefully show an empty View when any error occurs (syntax, undefined, type errors, etc.)
This is what I've tried, but it doesn't seem to fail gracefully. The whole app still crashes with this implementation.
const Parent = (props) => {
try{
return (<Child/>) //if Child logic crashes for any reason, return a blank view.
}catch(err){
return <View/>
}
}
Via Active questions tagged javascript - Stack Overflow https://ift.tt/2FdjaAW
Comments
Post a Comment