In my React app, I'm checking for nextProps like so:
componentWillReceiveProps(nextProps) {
if (nextProps.invite && nextProps.invite.status) {
}
}
I need the above because it's possible nextProps.invite is undefined so if I had just nextProps.invite.status
I would get a JS console undefined error...
Is there a cleaner, more efficient way to write the above logic?