Skip to content

Commit d624f49

Browse files
author
Josh Habdas
committed
Backpedal on use of invariant
1 parent 0405e82 commit d624f49

3 files changed

Lines changed: 1 addition & 21 deletions

File tree

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
"eslint-plugin-mocha": "^1.0.0",
4747
"eslint-plugin-react": "^3.5.1",
4848
"faker": "^3.0.1",
49-
"fbjs": "^0.4.0",
5049
"gulp": "^3.9.0",
5150
"gulp-help": "^1.6.1",
5251
"gulp-html-replace": "^1.5.4",

src/elements/Segment/Segments.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,13 @@
1-
import React, {Children, Component, PropTypes} from 'react';
2-
import _ from 'lodash';
3-
import invariant from 'fbjs/lib/invariant';
1+
import React, {Component, PropTypes} from 'react';
42
import classNames from 'classnames';
53
import META from 'src/utils/Meta';
6-
import Segment from './Segment';
74

85
export default class Segments extends Component {
96
static propTypes = {
107
children: PropTypes.node,
118
className: PropTypes.string,
129
};
1310

14-
componentDidMount() {
15-
const {children} = this.props;
16-
17-
invariant(
18-
!_.any( Children.map(children, child => child.type !== Segment) ),
19-
'May only contain children of type Segment.',
20-
);
21-
}
22-
2311
static _meta = {
2412
library: META.library.semanticUI,
2513
name: 'Segments',

test/specs/elements/Segment/Segments-test.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@ describe('Segments', () => {
3333
});
3434

3535
it('only allows children of type Segment', () => {
36-
expect(global.shallowRender(
37-
<Segments>Some text</Segments>
38-
)).to.throw;
3936

40-
// FIXME: Figure out why this is giving false positives
41-
expect(global.shallowRender(
42-
<Segments>Some text</Segments>
43-
)).to.not.throw;
4437
});
4538
});

0 commit comments

Comments
 (0)