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:
@@ -104,7 +104,7 @@ const getRouterConfig = () => {
|
|||||||
const config = (window as any).woonoowCustomer;
|
const config = (window as any).woonoowCustomer;
|
||||||
return {
|
return {
|
||||||
useBrowserRouter: config?.useBrowserRouter ?? true,
|
useBrowserRouter: config?.useBrowserRouter ?? true,
|
||||||
basePath: config?.basePath || '/store',
|
basePath: config?.basePath ?? '/store',
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user