I know what a ternary operator is in React.
When I'm developing a React Native app I encounter this kind of syntax that is covered by my ESLint as an unexpected token:
ESLint: Parsing error: Unexpected token .
It goes like this:
const routeName = route.state?.routes[route.state.index]?.name ?? INITIAL_ROUTE_NAME;
What does that mean? It uses null coalescing operator in the end, however, I can't understand what the question mark does before a dot.
I know it is the correct syntax because it is a template from expo and they're very popular in the React Native development community.
Can anyone help me explain?