Fix nested components - render functions now return i32
Changes: - Component render functions return i32 (root element) instead of void - Nested components (yield SomeComponent()) now work correctly - Added main() entry point that calls top-level component and sets root - Updated runtime to call main() instead of render_ComponentName() Note: Active state in ternary expressions still needs reactive updates This commit fixes the nested component rendering issue All tests passing (51 passed, 2 skipped) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
adf95f424d
commit
b0e38db22c
26 files changed
+2310
-1222
No files matched your search
@@ -306,15 +306,13 @@ class RitzLoader {
|
||||
|
||||
this.setStatus(`⏳ Rendering ${componentName}...`);
|
||||
|
||||
// Call the render function with props
|
||||
const renderFn = instance.exports[`render_${componentName}`];
|
||||
if (!renderFn) {
|
||||
throw new Error(`render_${componentName} not found in WASM exports`);
|
||||
// Call the main entry point (which renders top-level component and sets root)
|
||||
const mainFn = instance.exports.main;
|
||||
if (!mainFn) {
|
||||
throw new Error(`main function not found in WASM exports`);
|
||||
}
|
||||
|
||||
// Pass props as positional arguments
|
||||
const propValues = Object.values(props);
|
||||
renderFn(...propValues);
|
||||
mainFn();
|
||||
|
||||
// Update signals
|
||||
runtime.updateSignals();
|
||||
|
||||
Reference in new issue
Block a user