rusackas commented on code in PR #39535:
URL: https://github.com/apache/superset/pull/39535#discussion_r3263895583
##########
superset-frontend/packages/superset-ui-core/src/components/AsyncEsmComponent/index.tsx:
##########
@@ -93,7 +99,7 @@ export function AsyncEsmComponent<
// @ts-expect-error -- generic forwardRef has PropsWithoutRef
incompatibility with FullProps
const AsyncComponent: AsyncComponent = forwardRef(function AsyncComponent(
props: FullProps,
- ref,
+ ref: ForwardedRef<ComponentType<FullProps>>,
Review Comment:
Declining — the `@ts-expect-error` directive above the `forwardRef` call is
the deliberate workaround for the `PropsWithoutRef` incompatibility with the
generic `FullProps`. Changing the ref type to match `RefAttributes<unknown>`
would make that directive unused (warning) and the underlying
generic-forwardRef issue wouldn't actually go away. Leaving as-is.
##########
superset-frontend/packages/superset-ui-core/src/components/ModalTrigger/index.tsx:
##########
@@ -84,7 +90,7 @@ export const ModalTrigger = forwardRef(
setShowModal(true);
};
- if (ref) {
+ if (ref && typeof ref !== 'function') {
ref.current = { close, open, showModal }; // eslint-disable-line
}
Review Comment:
Good catch — fixed in 49dbed21. Added the callback-ref branch so parents
passing a function ref (`(value) => setRef(value)`) can now access
close/open/showModal. The previous `if (ref && typeof ref !== 'function')`
silently no-op'd for callback refs.
##########
superset-frontend/packages/superset-ui-core/src/components/TimezoneSelector/index.tsx:
##########
@@ -26,6 +26,7 @@ import {
getOffsetKey,
DEFAULT_TIMEZONE,
} from './TimezoneOptionsCache';
+import type { LabeledValue } from 'antd/es/select';
Review Comment:
Fixed in 49dbed21. Switched to `import type { LabeledValue } from
'@superset-ui/core/components'` (re-exported via Select/types). Matches
CLAUDE.md rule against direct antd imports.
--
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]