UNPKG

tslint-react-hooks

Version:

TSLint rule that enforces the Rules of Hooks

10 lines (9 loc) 487 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const is_react_api_expression_1 = require("./is-react-api-expression"); const reactComponentDecorators = ['forwardRef', 'memo']; /** * Tests is an expression is a React top-level API component decorator (e.g. `React.forwardRef`, * `React.memo`) */ exports.isReactComponentDecorator = is_react_api_expression_1.isReactApiExpression(identifier => reactComponentDecorators.includes(identifier.text));