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

Method _render_model

src/py/reactpy/reactpy/core/layout.py:231–250  ·  view source on GitHub ↗
(
        self,
        exit_stack: AsyncExitStack,
        old_state: _ModelState | None,
        new_state: _ModelState,
        raw_model: Any,
    )

Source from the content-addressed store, hash-verified

229 }
230
231 async def _render_model(
232 self,
233 exit_stack: AsyncExitStack,
234 old_state: _ModelState | None,
235 new_state: _ModelState,
236 raw_model: Any,
237 ) -> None:
238 try:
239 new_state.model.current = {"tagName": raw_model["tagName"]}
240 except Exception as e: # nocov
241 msg = f"Expected a VDOM element dict, not {raw_model}"
242 raise ValueError(msg) from e
243 if "key" in raw_model:
244 new_state.key = new_state.model.current["key"] = raw_model["key"]
245 if "importSource" in raw_model:
246 new_state.model.current["importSource"] = raw_model["importSource"]
247 self._render_model_attributes(old_state, new_state, raw_model)
248 await self._render_model_children(
249 exit_stack, old_state, new_state, raw_model.get("children", [])
250 )
251
252 def _render_model_attributes(
253 self,

Calls 3

getMethod · 0.45

Tested by

no test coverage detected