Skip to content

Commit 58f5601

Browse files
Fix TsClosureComponent
Co-authored-by: Claudia Meadows <[email protected]>
1 parent 5f041de commit 58f5601

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

docs/jsx.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,9 @@ The following code will work without errors:
320320
* Use TranslatedComponent to create Closure Components that can be inspected by TypeScript.
321321
*/
322322
export function TranslatedComponent<T>(create: m.ClosureComponent<T>) {
323-
return (attrs: T) => {
324-
const vNode = attrs as m.Vnode<T>;
325-
return create(vNode) as unknown as JSX.Element;
326-
}
323+
return create as any as (
324+
(attrs: T & Mithril.CommonAttributes<T, unknown>) => JSX.Element
325+
)
327326
}
328327

329328

0 commit comments

Comments
 (0)