A clear and concise description of what the feature is
Tighten the consumer-facing TypeScript surface — replace accidental any on public types (hook return values, handler arguments like onChange, the values read off a spring) with accurate types, so the API describes what it actually accepts and returns. Scope is any that leaks into user code, not the deliberate variance any the engine relies on internally.
Two examples in the code today, both in packages/core/src/types/props.ts:
// Every lifecycle callback is `any` — handler arguments are unchecked
export interface ReservedEventProps {
onStart?: any
onChange?: any
onRest?: any
onDestroyed?: any
// …
}
// Reserved animation/transition props are `any`, including the render prop
export interface ReservedProps extends ReservedEventProps {
to?: any
from?: any
config?: any
enter?: any
leave?: any
children?: any
// …
}
Why should this feature be included?
Accidental any on public surfaces silently switches off type-checking for consumers: no autocomplete, no error when the shape is wrong, no editor guidance. It's a recurring source of user-reported bugs:
Tightening these makes the real public type surface explicit and gives consumers accurate IntelliSense and call-site errors.
A clear and concise description of what the feature is
Tighten the consumer-facing TypeScript surface — replace accidental
anyon public types (hook return values, handler arguments likeonChange, the values read off a spring) with accurate types, so the API describes what it actually accepts and returns. Scope isanythat leaks into user code, not the deliberate varianceanythe engine relies on internally.Two examples in the code today, both in
packages/core/src/types/props.ts:Why should this feature be included?
Accidental
anyon public surfaces silently switches off type-checking for consumers: no autocomplete, no error when the shape is wrong, no editor guidance. It's a recurring source of user-reported bugs:onChangehandler #2183 —onChangereceives the wrong (any) result type.<Spring>render prop is inferred asany(breaks undernoImplicitAny).onDestroyedis wrong #1114 —onDestroyedtype definition is wrong.useTransitioninference fails when styles are set via functions.Tightening these makes the real public type surface explicit and gives consumers accurate IntelliSense and call-site errors.