Skip to content

Commit cf01fab

Browse files
author
Alexander Fedyashov
committed
perf(props): Remove propTypes from production build
1 parent a7f4c55 commit cf01fab

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

src/elements/Rail/Rail.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,15 @@ Rail._meta = {
5454

5555
if (process.env.NODE_ENV !== 'production') {
5656
Rail.props = {
57-
close: ['very'],
58-
position: SUI.FLOATS,
59-
size: _.without(SUI.SIZES, 'medium'),
57+
close: {
58+
values: ['very'],
59+
},
60+
position: {
61+
values: SUI.FLOATS,
62+
},
63+
size: {
64+
values: _.without(SUI.SIZES, 'medium'),
65+
},
6066
}
6167

6268
Rail.propTypes = {

test/specs/commonTests.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,8 @@ const _definesPropOptions = (Component, propKey) => {
490490
it(`defines ${propKey} options in Component.props`, () => {
491491
Component.should.have.any.keys('props')
492492
Component.props.should.have.any.keys(propKey)
493-
Component.props[propKey].should.be.an('array')
493+
Component.props[propKey].should.have.any.keys('values')
494+
Component.props[propKey].values.should.be.an('array')
494495
})
495496
}
496497

test/specs/lib/getUnhandledProps-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ beforeEach(() => {
1414

1515
describe('getUnhandledProps', () => {
1616
it('removes props defined in _meta.props', () => {
17-
TestComponent._meta = {props: ['data-remove-me']}
17+
TestComponent._meta = { props: ['data-remove-me'] }
1818
shallow(<TestComponent />)
1919
.should.not.have.prop('data-remove-me', 'thanks')
2020
})

0 commit comments

Comments
 (0)