@nitronjs/framework 0.2.16 → 0.2.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -527,7 +527,7 @@ class Builder {
527
527
 
528
528
  this.#manifest[key] = {
529
529
  css: [...cssSet],
530
- layouts: layoutChain.map(l => l.name.toLowerCase()),
530
+ layouts: layoutChain.map(l => l.name),
531
531
  hydrationScript: null
532
532
  };
533
533
  }
package/lib/View/View.js CHANGED
@@ -348,7 +348,10 @@ class View {
348
348
  React.createElement(Component, params)
349
349
  );
350
350
  } else {
351
- element = React.createElement(Component, params);
351
+ element = Component(params);
352
+ if (element && typeof element.then === "function") {
353
+ element = await element;
354
+ }
352
355
  }
353
356
 
354
357
  if (layoutModules.length > 0) {
@@ -357,7 +360,11 @@ class View {
357
360
 
358
361
  for (let i = layoutModules.length - 1; i >= 0; i--) {
359
362
  const LayoutComponent = layoutModules[i].default;
360
- element = React.createElement(LayoutComponent, { children: element });
363
+ element = LayoutComponent({ children: element });
364
+
365
+ if (element && typeof element.then === "function") {
366
+ element = await element;
367
+ }
361
368
  }
362
369
 
363
370
  html = await this.#renderToHtml(element);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nitronjs/framework",
3
- "version": "0.2.16",
3
+ "version": "0.2.18",
4
4
  "description": "NitronJS is a modern and extensible Node.js MVC framework built on Fastify. It focuses on clean architecture, modular structure, and developer productivity, offering built-in routing, middleware, configuration management, CLI tooling, and native React integration for scalable full-stack applications.",
5
5
  "bin": {
6
6
  "njs": "./cli/njs.js"