From a53b7c17dfa2e03e816e33db5295b7c019ee1f7d Mon Sep 17 00:00:00 2001 From: Romuald Brillout Date: Wed, 14 Aug 2024 15:41:01 +0200 Subject: [PATCH] fix: support callable cumulative configs --- packages/vike-react/src/renderer/getHeadSetting.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/vike-react/src/renderer/getHeadSetting.tsx b/packages/vike-react/src/renderer/getHeadSetting.tsx index 9e8f7894..92279d27 100644 --- a/packages/vike-react/src/renderer/getHeadSetting.tsx +++ b/packages/vike-react/src/renderer/getHeadSetting.tsx @@ -17,10 +17,8 @@ function getHeadSetting(headSetting: HeadSetting, pageContext: PageContext & } // Set by +configName.js + const getCallable = (val: unknown) => (isCallable(val) ? val(pageContext) : val) const val = pageContext.config[headSetting] - if (isCallable(val)) { - return val(pageContext) as any - } else { - return val as any - } + if (Array.isArray(val)) return val.map(getCallable) as any // cumulative configs + return getCallable(val) as any }