|
48 | 48 | - [isMemberExpressionOfReactMember](README.md#ismemberexpressionofreactmember)
|
49 | 49 | - [isMemoOrForwardRefCall](README.md#ismemoorforwardrefcall)
|
50 | 50 | - [isPureComponent](README.md#ispurecomponent)
|
| 51 | +- [isReactHookCall](README.md#isreacthookcall) |
51 | 52 | - [isReactHookCallWithName](README.md#isreacthookcallwithname)
|
52 | 53 | - [isUseCallbackCall](README.md#isusecallbackcall)
|
53 | 54 | - [isUseContextCall](README.md#isusecontextcall)
|
|
152 | 153 |
|
153 | 154 | #### Type declaration
|
154 | 155 |
|
155 |
| -| Name | Type | |
156 |
| -| :----- | :-------------------- | |
157 |
| -| `_` | `string` | |
158 |
| -| `cost` | `number` | |
159 |
| -| `id` | `TSESTree.Identifier` | |
160 |
| -| `name` | `string` | |
161 |
| -| `node` | `TSESTreeFunction` | |
| 156 | +| Name | Type | |
| 157 | +| :---------- | :-------------------------- | |
| 158 | +| `_` | `string` | |
| 159 | +| `hookCalls` | `TSESTree.CallExpression`[] | |
| 160 | +| `id` | `TSESTree.Identifier` | |
| 161 | +| `name` | `string` | |
| 162 | +| `node` | `TSESTreeFunction` | |
162 | 163 |
|
163 | 164 | ## Variables
|
164 | 165 |
|
@@ -678,6 +679,25 @@ Check if a node is a React PureComponent
|
678 | 679 |
|
679 | 680 | ---
|
680 | 681 |
|
| 682 | +### isReactHookCall |
| 683 | + |
| 684 | +▸ **isReactHookCall**(`node`): `void` |
| 685 | + |
| 686 | +TODO: Implement this function. |
| 687 | +Check if the given node is a React Hook call by its name and its hierarchy. |
| 688 | + |
| 689 | +#### Parameters |
| 690 | + |
| 691 | +| Name | Type | Description | |
| 692 | +| :----- | :--------------- | :----------------- | |
| 693 | +| `node` | `CallExpression` | The node to check. | |
| 694 | + |
| 695 | +#### Returns |
| 696 | + |
| 697 | +`void` |
| 698 | + |
| 699 | +--- |
| 700 | + |
681 | 701 | ### isReactHookCallWithName
|
682 | 702 |
|
683 | 703 | ▸ **isReactHookCallWithName**(`name`): (`node`: `CallExpression`, `context`: `Readonly`\<`RuleContext`\<`string`, readonly `unknown`[]\>\>, `pragma`: `string`) => `boolean`
|
@@ -993,16 +1013,20 @@ _ = <Component rows={[{ render: () => <div /> }]} />;
|
993 | 1013 |
|
994 | 1014 | ▸ **unsafeIsReactHookCall**(`node`): `boolean`
|
995 | 1015 |
|
| 1016 | +Check if the given node is a React Hook call by its name. |
| 1017 | + |
996 | 1018 | #### Parameters
|
997 | 1019 |
|
998 |
| -| Name | Type | |
999 |
| -| :----- | :--------------- | |
1000 |
| -| `node` | `CallExpression` | |
| 1020 | +| Name | Type | Description | |
| 1021 | +| :----- | :--------------- | :----------------- | |
| 1022 | +| `node` | `CallExpression` | The node to check. | |
1001 | 1023 |
|
1002 | 1024 | #### Returns
|
1003 | 1025 |
|
1004 | 1026 | `boolean`
|
1005 | 1027 |
|
| 1028 | +`true` if the node is a React hook call, `false` otherwise. |
| 1029 | + |
1006 | 1030 | ---
|
1007 | 1031 |
|
1008 | 1032 | ### unsafeIsRenderFunction
|
|
0 commit comments