Skip to content

Commit

Permalink
bump 3.0.0 to fix react lifecycle warning
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Dec 2, 2019
1 parent 6b651b0 commit f472a73
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "rc-trigger",
"version": "3.0.0-rc.3",
"version": "3.0.0",
"description": "base abstract trigger component for react",
"keywords": [
"react",
Expand Down Expand Up @@ -62,6 +62,6 @@
"raf": "^3.4.0",
"rc-align": "^2.4.1",
"rc-animate": "^3.0.0-rc.1",
"rc-util": "^4.4.0"
"rc-util": "^4.15.7"
}
}
7 changes: 4 additions & 3 deletions src/index.js
Expand Up @@ -8,6 +8,7 @@ import { getAlignFromPlacement, getAlignPopupClassName } from './utils';
import ContainerRender from 'rc-util/lib/ContainerRender';
import Portal from 'rc-util/lib/Portal';
import classNames from 'classnames';
import unsafeLifecyclesPolyfill from 'rc-util/lib/unsafeLifecyclesPolyfill';

function noop() {
}
Expand All @@ -25,7 +26,7 @@ const ALL_HANDLERS = ['onClick', 'onMouseDown', 'onTouchStart', 'onMouseEnter',

const IS_REACT_16 = !!createPortal;

export default class Trigger extends React.Component {
class Trigger extends React.Component {
static propTypes = {
children: PropTypes.any,
action: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
Expand Down Expand Up @@ -111,9 +112,7 @@ export default class Trigger extends React.Component {
this.state = {
popupVisible,
};
}

componentWillMount() {
ALL_HANDLERS.forEach((h) => {
this[`fire${h}`] = (e) => {
this.fireEvents(h, e);
Expand Down Expand Up @@ -636,3 +635,5 @@ export default class Trigger extends React.Component {
];
}
}

export default unsafeLifecyclesPolyfill(Trigger);

1 comment on commit f472a73

@afc163
Copy link
Member

@afc163 afc163 commented on f472a73 Dec 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.