Skip to content

Commit 285ab75

Browse files
Apply second call to finish invoking class components.
1 parent 9d99422 commit 285ab75

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tdom/transformer.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,13 @@ def interpolate_component(
175175
callable_info = get_callable_info(component_callable)
176176
kwargs = _prep_component_kwargs(callable_info, resolved_attrs, system=system_dict)
177177
res = component_callable(**kwargs)
178+
179+
# @DESIGN: callable or has_attr('__call__') for class components?
180+
if callable(res):
181+
# Class components are built and returned and then need to be called
182+
# to get their template.
183+
res = res()
184+
178185
# @DESIGN: Determine return signature via runtime inspection?
179186
if isinstance(res, tuple):
180187
result_template, comp_info = res

0 commit comments

Comments
 (0)