FindAllDefinitionsResolver
Finds all React component definitions in a file, regardless of whether they are exported.
It detects:
React.createClass()calls- Class components extending
React.ComponentorReact.PureComponent - Classes with a
render()method - Function components that return JSX or
React.createElement() React.forwardRef()components
The resolver can follow imported references with the configured importer.
Examples
When the FindAllDefinitionsResolver is active, both components in this file
are returned.
component.tsx
import React from 'react';
function Button() {
return <button />;
}
class Link extends React.Component {
render() {
return <a />;
}
}Source
Last updated on