Skip to content

Commit

Permalink
fix: add prop to opt out of ssr full
Browse files Browse the repository at this point in the history
  • Loading branch information
huan-qiu committed Sep 26, 2023
1 parent 15d60f4 commit 9143b72
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Menu.tsx
Expand Up @@ -78,6 +78,9 @@ export interface MenuProps
activeKey?: string;
defaultActiveFirst?: boolean;

// SSR control
ssr?: 'full' | 'off';

// Selection
selectable?: boolean;
multiple?: boolean;
Expand Down Expand Up @@ -183,6 +186,9 @@ const Menu = React.forwardRef<MenuRef, MenuProps>((props, ref) => {
activeKey,
defaultActiveFirst,

// SSR
ssr,

// Selection
selectable = true,
multiple = false,
Expand Down Expand Up @@ -239,6 +245,7 @@ const Menu = React.forwardRef<MenuRef, MenuProps>((props, ref) => {
const uuid = useUUID(id);

const isRtl = direction === 'rtl';
const ssrVal = ssr === 'off' ? undefined : 'full';

// ========================= Warn =========================
if (process.env.NODE_ENV !== 'production') {
Expand Down Expand Up @@ -581,7 +588,7 @@ const Menu = React.forwardRef<MenuRef, MenuProps>((props, ref) => {
? Overflow.INVALIDATE
: Overflow.RESPONSIVE
}
ssr="full"
ssr={ssrVal}
data-menu-list
onVisibleChange={newLastIndex => {
setLastVisibleIndex(newLastIndex);
Expand Down

0 comments on commit 9143b72

Please sign in to comment.