DEV Community

Discussion on: Container/View Pattern in React inc.hooks

Collapse
 
rmurati profile image
Redžep Murati

Hello. The ? operator will check only for the existence of value(it's called optional chaining).
Ex: userData?.email will return value of email variable if it exists otherwise undefined.
Here is a good documentation on this subject:
developer.mozilla.org/en-US/docs/W...
Hope u find this useful.