You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem
Due to how ComponentFactory type is declared, components must define generic types and then cast to specific types using as. For projects where type casting is not wanted, this causes an issue.
How do you reproduce the problem?
The ComponentFactory type is declared as:
After looking into this a bit more, it seems like changing types is actually a bit problematic wrt the topology library as well as potentially breaking client component factories. The proposed solution has issues when put in practice and I haven't found any other good type mechanism.
Describe the problem
Due to how
ComponentFactory
type is declared, components must define generic types and then cast to specific types usingas
. For projects where type casting is not wanted, this causes an issue.How do you reproduce the problem?
The
ComponentFactory
type is declared as:This has a side effect where components, even if they work with
Edge
, declare their type aselement: GraphElement
and then end up typecasting to their correct type as seen here: https://github.com/patternfly/react-topology/blob/main/packages/demo-app-ts/src/components/DemoDefaultEdge.tsxI would expect to be able to define my edge component as:
I believe this could be solved by updating the
ComponentFactory
type definition:Expected behavior
A clear and concise description of the expected behavior.
Is this issue blocking you?
Not blocking. Continue to cast.
What is your product and what release date are you targeting?
RHOAI 2.11
Any other information?
The text was updated successfully, but these errors were encountered: