File tree 1 file changed +28
-0
lines changed
packages/eslint-plugin-react-hooks/__tests__
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -1129,6 +1129,34 @@ const tests = {
1129
1129
` ,
1130
1130
errors : [ asyncComponentHookError ( 'useState' ) ] ,
1131
1131
} ,
1132
+ {
1133
+ code : normalizeIndent `
1134
+ async function Page() {
1135
+ useId();
1136
+ React.useId();
1137
+ }
1138
+ ` ,
1139
+ errors : [
1140
+ asyncComponentHookError ( 'useId' ) ,
1141
+ asyncComponentHookError ( 'React.useId' ) ,
1142
+ ] ,
1143
+ } ,
1144
+ {
1145
+ code : normalizeIndent `
1146
+ async function useAsyncHook() {
1147
+ useId();
1148
+ }
1149
+ ` ,
1150
+ errors : [ asyncComponentHookError ( 'useId' ) ] ,
1151
+ } ,
1152
+ {
1153
+ code : normalizeIndent `
1154
+ async function notAHook() {
1155
+ useId();
1156
+ }
1157
+ ` ,
1158
+ errors : [ functionError ( 'useId' , 'notAHook' ) ] ,
1159
+ } ,
1132
1160
{
1133
1161
code : normalizeIndent `
1134
1162
Hook.use();
You can’t perform that action at this time.
0 commit comments