mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
```js // here, `a?.b.c` is a single optional chain // (evaluates to undefined if a is nullish) a?.b.c; // here, 'a?.b` is an optional chain, and `.c` is an unconditional load // (nullthrows if a is nullish) (a?.b).c; ``` --- Next PR in stack will add a bailout for `(a?.b).c`. (If we want to properly handle `(a?.b).c`, we might want to model optional chains explicitly in the HIR. We currently assume that any `PropertyLoad` whose lhs is an optional property load is read conditionally.)