fix: React Router basename - use ?? instead of || for empty string support

When SPA is frontpage, basePath is empty string. JavaScript || treats '' as falsy
and falls back to /store. Changed to ?? (nullish coalescing) so empty string works.
This commit is contained in:
Dwindi Ramadhana
2026-01-10 01:00:46 +07:00
parent 3357fbfcf1
commit 1ff9a36af3

View File

@@ -104,7 +104,7 @@ const getRouterConfig = () => {
const config = (window as any).woonoowCustomer;
return {
useBrowserRouter: config?.useBrowserRouter ?? true,
basePath: config?.basePath || '/store',
basePath: config?.basePath ?? '/store',
};
};