diff --git a/packages/react-vant/src/cell/CellGroup.tsx b/packages/react-vant/src/cell/CellGroup.tsx index f8d5c89b7..0e362826c 100644 --- a/packages/react-vant/src/cell/CellGroup.tsx +++ b/packages/react-vant/src/cell/CellGroup.tsx @@ -11,29 +11,22 @@ const CellGroup: React.FC = (props) => { const [bem] = createNamespace('cell-group', prefixCls); const renderGroup = () => ( -
+
{props.children}
); - const renderTitle = () =>
{title}
; + const renderTitle = () => { + if (title) return
{title}
; + return null; + }; - if (title) - return ( - <> - {renderTitle()} - {renderGroup()} - - ); - - return renderGroup(); + return ( +
+ {renderTitle()} + {renderGroup()} +
+ ); }; CellGroup.defaultProps = {