Skip to content

Commit aba14d9

Browse files
mdctleokyletsang
andauthored
refactor(Row): remove noGutters prop (react-bootstrap#5761)
* changed .no-gutter to g-0 * removed noGutter completely * removed noGutters prop from interface also * warning fix * removed default props * changed .no-gutter to g-0 * removed noGutter completely * Update RowSpec.js Co-authored-by: Kyle Tsang <[email protected]>
1 parent d08e434 commit aba14d9

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

src/Row.tsx

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ type RowColumns = RowColWidth | { cols?: RowColWidth };
2626
export interface RowProps
2727
extends BsPrefixProps,
2828
React.HTMLAttributes<HTMLElement> {
29-
noGutters?: boolean;
3029
xs?: RowColumns;
3130
sm?: RowColumns;
3231
md?: RowColumns;
@@ -51,8 +50,6 @@ const propTypes = {
5150
*/
5251
bsPrefix: PropTypes.string,
5352

54-
/** Removes the gutter spacing between `Col`s as well as any added negative margins. */
55-
noGutters: PropTypes.bool.isRequired,
5653
as: PropTypes.elementType,
5754

5855
/**
@@ -104,9 +101,6 @@ const propTypes = {
104101
xxl: rowColumns,
105102
};
106103

107-
const defaultProps = {
108-
noGutters: false,
109-
};
110104

111105
const Row: BsPrefixRefForwardingComponent<'div', RowProps> = React.forwardRef<
112106
HTMLDivElement,
@@ -116,7 +110,6 @@ const Row: BsPrefixRefForwardingComponent<'div', RowProps> = React.forwardRef<
116110
{
117111
bsPrefix,
118112
className,
119-
noGutters,
120113
// Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
121114
as: Component = 'div',
122115
...props
@@ -147,19 +140,13 @@ const Row: BsPrefixRefForwardingComponent<'div', RowProps> = React.forwardRef<
147140
<Component
148141
ref={ref}
149142
{...props}
150-
className={classNames(
151-
className,
152-
decoratedBsPrefix,
153-
noGutters && 'no-gutters',
154-
...classes,
155-
)}
143+
className={classNames(className, decoratedBsPrefix, ...classes)}
156144
/>
157145
);
158146
},
159147
);
160148

161149
Row.displayName = 'Row';
162150
Row.propTypes = propTypes;
163-
Row.defaultProps = defaultProps;
164151

165152
export default Row;

test/RowSpec.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,4 @@ describe('Row', () => {
4040
it('should allow custom elements instead of "div"', () => {
4141
mount(<Row as="section" />).assertSingle('section.row');
4242
});
43-
44-
it('Should render no-gutters correctly', () => {
45-
mount(<Row noGutters />).assertSingle('.row.no-gutters');
46-
});
4743
});

0 commit comments

Comments
 (0)