rusackas commented on code in PR #39458:
URL: https://github.com/apache/superset/pull/39458#discussion_r3383268477


##########
superset-frontend/packages/superset-ui-core/src/chart/components/reactify.tsx:
##########
@@ -49,66 +61,102 @@ export interface RenderFuncType<Props> {
   propTypes?: WeakValidationMap<Props & ReactifyProps>;
 }
 
+export interface ReactifiedComponentRef {
+  container?: HTMLDivElement;
+}
+
+export type ReactifiedComponent<Props> = ForwardRefExoticComponent<
+  PropsWithoutRef<Props & ReactifyProps> & 
RefAttributes<ReactifiedComponentRef>
+>;
+
+// Return the widest public type that covers "use it as a React component" so
+// TypeScript consumers who previously relied on `ComponentClass<...>` still
+// compile. Callers that want the new ref-aware surface can narrow to
+// `ReactifiedComponent<Props>` explicitly.

Review Comment:
   Good catch — applied your suggested wording in d73fff7b12. The comment now 
states that JSX callers and `ComponentType<...>`-typed variables stay 
compatible, while callers with explicit `ComponentClass<...>` annotations must 
widen to `ComponentType`, and that the forwardRef surface is available by 
narrowing to `ReactifiedComponent<Props>`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to