mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] hooks: improve useRef typings
With this commit, we can get the type for the target component for a ref. By default, if the generic type is not given, the ref will simply use the base Component type.
This commit is contained in:
+1
-1
@@ -267,7 +267,7 @@ describe("hooks", () => {
|
||||
class WidgetC extends Component {
|
||||
static template = xml`<div class="outer-div">Hello<WidgetB t-ref="mywidgetb" /></div>`;
|
||||
static components = { WidgetB };
|
||||
ref = useRef("mywidgetb");
|
||||
ref = useRef<WidgetB>("mywidgetb");
|
||||
}
|
||||
|
||||
const widget = new WidgetC();
|
||||
|
||||
Reference in New Issue
Block a user