@@ -133,7 +133,6 @@ let emitCodeItem ~config ~emitters ~moduleItemsEmitter ~env ~fileName
133133 match codeItem with
134134 | ImportValue {asPath; importAnnotation; type_; valueName} ->
135135 let importPath = importAnnotation.importPath in
136- let importFile = importAnnotation.name in
137136 let firstNameInPath, restOfPath =
138137 match valueName = asPath with
139138 | true -> (valueName, " " )
@@ -159,11 +158,6 @@ let emitCodeItem ~config ~emitters ~moduleItemsEmitter ~env ~fileName
159158 as function_)
160159 when retType |> EmitType. isTypeFunctionComponent ~fields ->
161160 (* JSX V3 *)
162- let componentName =
163- match importFile with
164- | "." | ".." -> None
165- | _ -> Some importFile
166- in
167161 let fields =
168162 fields
169163 |> List. map (fun (field : field ) ->
@@ -180,7 +174,7 @@ let emitCodeItem ~config ~emitters ~moduleItemsEmitter ~env ~fileName
180174 argTypes = [{aType = Object (closedFlag, fields); aName}];
181175 }
182176 in
183- Function { function_ with componentName}
177+ Function function_
184178 | Function
185179 ({argTypes = [{aType = Ident {name} as propsType; aName}]; retType} as
186180 function_)
@@ -189,11 +183,6 @@ let emitCodeItem ~config ~emitters ~moduleItemsEmitter ~env ~fileName
189183 match inlineOneLevel propsType with
190184 | Object (closedFlags , fields ) ->
191185 (* JSX V3 *)
192- let componentName =
193- match importFile with
194- | "." | ".." -> None
195- | _ -> Some importFile
196- in
197186 let fields =
198187 Ext_list. filter_map fields (fun (field : field ) ->
199188 match field.nameJS with
@@ -210,7 +199,7 @@ let emitCodeItem ~config ~emitters ~moduleItemsEmitter ~env ~fileName
210199 argTypes = [{aType = Object (closedFlags, fields); aName}];
211200 }
212201 in
213- Function { function_ with componentName}
202+ Function function_
214203 | _ -> type_)
215204 | _ -> type_
216205 in
@@ -276,26 +265,6 @@ let emitCodeItem ~config ~emitters ~moduleItemsEmitter ~env ~fileName
276265 typeVars : string list ;
277266 }
278267 end in
279- let getHookName () =
280- let chopSuffix suffix =
281- match resolvedNameStr = suffix with
282- | true -> " "
283- | false -> (
284- match Filename. check_suffix resolvedNameStr (" _" ^ suffix) with
285- | true -> Filename. chop_suffix resolvedNameStr (" _" ^ suffix)
286- | false -> resolvedNameStr)
287- in
288- let suffix =
289- if originalName = default then chopSuffix default
290- else if originalName = make then chopSuffix make
291- else resolvedNameStr
292- in
293- (fileName |> ModuleName. toString)
294- ^
295- match suffix = " " with
296- | true -> suffix
297- | false -> " _" ^ suffix
298- in
299268 let type_, hookType =
300269 match type_ with
301270 | Function
@@ -331,7 +300,7 @@ let emitCodeItem ~config ~emitters ~moduleItemsEmitter ~env ~fileName
331300 ResolvedName. fromString " Props" )
332301 else ResolvedName. fromString name |> ResolvedName. dot " Props"
333302 in
334- ( Function { function_ with componentName = Some (getHookName () )} ,
303+ ( Function function_,
335304 Some {HookType. propsType; resolvedTypeName; typeVars} )
336305 | Function
337306 ({argTypes = [{aType = Ident {name} as propsType}]; retType} as
@@ -359,7 +328,7 @@ let emitCodeItem ~config ~emitters ~moduleItemsEmitter ~env ~fileName
359328 let function_ =
360329 {function_ with argTypes = [{aName = " " ; aType = propsType}]}
361330 in
362- Function { function_ with componentName = Some (getHookName () )}
331+ Function function_
363332 | _ -> type_
364333 in
365334 (compType, None )
0 commit comments