TypeStat icon indicating copy to clipboard operation
TypeStat copied to clipboard

Expand incompleteTypes property fixes to referenced extended generics

Open JoshuaKGoldberg opened this issue 6 years ago • 0 comments
trafficstars

Similar to #180, but with function parameters of the generic type:

class Component<TState = {}> {
    setState(newState: Partial<TState> | ((oldState: TState) => TState)) { }
}

+ type ClickableState = {
+    clicks: number,
+ }

- class Clickable extends Component {
+ class Clickable extends Component<ClickableState> {
    state = {
        clicks: 0,
    };

    click() {
        this.setState(oldState => ({
            clicks: oldState.clicks + 1,
        }));
    }
}

JoshuaKGoldberg avatar Apr 28 '19 17:04 JoshuaKGoldberg