diff --git a/packages/vike-solid/integration/getPageElement.tsx b/packages/vike-solid/integration/getPageElement.tsx index 63b775f..98d3188 100644 --- a/packages/vike-solid/integration/getPageElement.tsx +++ b/packages/vike-solid/integration/getPageElement.tsx @@ -28,12 +28,12 @@ function Wrapper(props: { children: JSX.Element }) { ...(pageContext.config.Layout || []), // Outer wrapping ...(pageContext.config.Wrapper || []), - ]), + ].reverse()), ); }); const renderWrappers = (i: number = 0) => { - let item = wrappers.at(-(i + 1)); + let item = wrappers[i]; // Assumes reversed, and must access with `[i]` instead of `.at(i)` otherwise, wrapper's states are not persisted. if (!item) return props.children;