Skip to content

Commit

Permalink
Fix unknown props
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Jul 29, 2016
1 parent d1f6d34 commit 64b2ca8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
9 changes: 8 additions & 1 deletion components/badge/ScrollNumber.tsx
Expand Up @@ -3,6 +3,7 @@ import * as React from 'react';
import {findDOMNode} from 'react-dom';
import isCssAnimationSupported from '../_util/isCssAnimationSupported';
import assign from 'object-assign';
import omit from 'object-omit';

function getNumberArray(num) {
return num ?
Expand Down Expand Up @@ -124,7 +125,13 @@ export default class ScrollNumber extends React.Component<any, any> {
}

render() {
const props = assign({}, this.props, {
// fix https://fb.me/react-unknown-prop
const props = assign({}, omit(this.props, [
'count',
'onAnimated',
'component',
'prefixCls',
]), {
className: `${this.props.prefixCls} ${this.props.className}`,
});
return createElement(
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -33,6 +33,7 @@
"moment": "^2.14.1",
"normalize.css": "~4.2.0",
"object-assign": "~4.1.0",
"object-omit": "^1.0.0",
"rc-animate": "~2.3.0",
"rc-checkbox": "~1.4.0",
"rc-collapse": "~1.6.6",
Expand Down
7 changes: 6 additions & 1 deletion typings/custom.d.ts
Expand Up @@ -81,6 +81,11 @@ declare module 'object-assign' {
export default exports
}

declare module 'object-omit' {
var exports: any
export default exports
}

declare module 'rc-input-number' {
var exports: any
export default exports
Expand Down Expand Up @@ -156,7 +161,7 @@ declare module 'react-native-camera-roll-picker' {
var exports: any
export default exports
}

declare module 'react-timer-mixin'{
var exports: any
export default exports
Expand Down

0 comments on commit 64b2ca8

Please sign in to comment.