Skip to content

Commit

Permalink
fix: state persistence across new layout navigations.
Browse files Browse the repository at this point in the history
  • Loading branch information
Blankeos committed Dec 19, 2024
1 parent 938c6a9 commit 269d60c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vike-solid/integration/getPageElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 269d60c

Please sign in to comment.