From 9143b72870d5397e2835a2c1e2afe42417ffa7ff Mon Sep 17 00:00:00 2001 From: huan-qiu Date: Tue, 26 Sep 2023 17:02:28 +1300 Subject: [PATCH] fix: add prop to opt out of ssr full --- src/Menu.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Menu.tsx b/src/Menu.tsx index ef9db196..d116a6d3 100644 --- a/src/Menu.tsx +++ b/src/Menu.tsx @@ -78,6 +78,9 @@ export interface MenuProps activeKey?: string; defaultActiveFirst?: boolean; + // SSR control + ssr?: 'full' | 'off'; + // Selection selectable?: boolean; multiple?: boolean; @@ -183,6 +186,9 @@ const Menu = React.forwardRef((props, ref) => { activeKey, defaultActiveFirst, + // SSR + ssr, + // Selection selectable = true, multiple = false, @@ -239,6 +245,7 @@ const Menu = React.forwardRef((props, ref) => { const uuid = useUUID(id); const isRtl = direction === 'rtl'; + const ssrVal = ssr === 'off' ? undefined : 'full'; // ========================= Warn ========================= if (process.env.NODE_ENV !== 'production') { @@ -581,7 +588,7 @@ const Menu = React.forwardRef((props, ref) => { ? Overflow.INVALIDATE : Overflow.RESPONSIVE } - ssr="full" + ssr={ssrVal} data-menu-list onVisibleChange={newLastIndex => { setLastVisibleIndex(newLastIndex);