From addbecdae7d1caffdd1c0f45b1e6233c16bcebb6 Mon Sep 17 00:00:00 2001 From: Romuald Brillout Date: Tue, 20 Aug 2024 15:05:26 +0200 Subject: [PATCH] fix: make useConfig() work for vike-solid hooks --- vike-solid/utils/callCumulativeHooks.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/vike-solid/utils/callCumulativeHooks.ts b/vike-solid/utils/callCumulativeHooks.ts index e4ba0ed..0af6cee 100644 --- a/vike-solid/utils/callCumulativeHooks.ts +++ b/vike-solid/utils/callCumulativeHooks.ts @@ -1,7 +1,15 @@ -export async function callCumulativeHooks(values: undefined | unknown[], pageContext: unknown): Promise { +export { callCumulativeHooks }; + +import { providePageContext } from "vike/getPageContext"; + +async function callCumulativeHooks( + values: undefined | unknown[], + pageContext: Record, +): Promise { if (!values) return []; const valuesPromises = values.map((val) => { if (typeof val === "function") { + providePageContext(pageContext); // Hook return val(pageContext); } else {