Closed janbiasi closed 6 years ago
Cool 👍- one last question is it still possible to call getComponentByDomNode(node)
without setting the generic? and if yes will the result be of type GondelComponent?
Is it still possible to call getComponentByDomNode(node) without setting the generic? and if yes will the result be of type GondelComponent?
Yes for sure it is! That's the default behaviour, short example:
// button is of type 'GondelComponent'
const a = getComponentByDomNode(buttonNode);
// button is of type 'Button'
const b = getComponentByDomNode<Button>(buttonNode);
Sidenote: I didn't see any documentation regarding the dom-utils
, I think we should expand the documentation in the next steps for better usability.
Merged in #18 👍
getComponentByDomNode(node) as Button
is nowgetComponentByDomNode<Button>(node)
getComponentByDomNodeAsync<Button>(node).then(b => ... )
findComponents<Button>(buttonGroup)
GondelComponent
so the casting should work as usual.