(attribute)
| 72862 | : undefined; |
| 72863 | } |
| 72864 | function getContextualTypeForJsxAttribute(attribute) { |
| 72865 | // When we trying to resolve JsxOpeningLikeElement as a stateless function element, we will already give its attributes a contextual type |
| 72866 | // which is a type of the parameter of the signature we are trying out. |
| 72867 | // If there is no contextual type (e.g. we are trying to resolve stateful component), get attributes type from resolving element's tagName |
| 72868 | if (ts.isJsxAttribute(attribute)) { |
| 72869 | var attributesType = getApparentTypeOfContextualType(attribute.parent); |
| 72870 | if (!attributesType || isTypeAny(attributesType)) { |
| 72871 | return undefined; |
| 72872 | } |
| 72873 | return getTypeOfPropertyOfContextualType(attributesType, attribute.name.escapedText); |
| 72874 | } |
| 72875 | else { |
| 72876 | return getContextualType(attribute.parent); |
| 72877 | } |
| 72878 | } |
| 72879 | // Return true if the given expression is possibly a discriminant value. We limit the kinds of |
| 72880 | // expressions we check to those that don't depend on their contextual type in order not to cause |
| 72881 | // recursive (and possibly infinite) invocations of getContextualType. |
no test coverage detected
searching dependent graphs…