MCPcopy Index your code
hub / github.com/reactive-python/reactpy / constructor

Function constructor

src/py/reactpy/reactpy/core/vdom.py:222–229  ·  view source on GitHub ↗
(*attributes_and_children: Any, **kwargs: Any)

Source from the content-addressed store, hash-verified

220 """
221
222 def constructor(*attributes_and_children: Any, **kwargs: Any) -> VdomDict:
223 model = vdom(tag, *attributes_and_children, **kwargs)
224 if not allow_children and "children" in model:
225 msg = f"{tag!r} nodes cannot have children."
226 raise TypeError(msg)
227 if import_source:
228 model["importSource"] = import_source
229 return model
230
231 # replicate common function attributes
232 constructor.__name__ = tag

Callers 4

model_streamFunction · 0.50
model_streamFunction · 0.50
_rewrite_propsFunction · 0.50
HotSwapFunction · 0.50

Calls 1

vdomFunction · 0.85

Tested by

no test coverage detected