Flow + React + Props: Assigning a class type to parameter does not resolve the props

Hi

When using the following code the TestComponent does not resolve the props from A. When I use A directly it works as expected. Is there something wrong from my side?

Greets

// @flow
import React, {Component} from 'react';

type AType = {
myProp1: string,
myProp2: string,
};

class A extends Component<AType> {
props: AType;
}

type BType = {
myProp1: string,
myProp2: string,
};

function myRender(TestComponent: A): Component {
class B extends Component<BType> {
render(): Component {
return <TestComponent />;
// return <A />;
}
}

return B;
}

myRender(A);

 



 

1
1 comment

This way of defining components requires providing special support. Please feel free to file a request to youtrack, https://youtrack.jetbrains.com/issues/WEB

0

Please sign in to leave a comment.