Skip to content

Commit

Permalink
Bump ver to 2.0.0, fix react legacy methods not starting with unsafe …
Browse files Browse the repository at this point in the history
…issue
  • Loading branch information
fangpenlin committed Aug 15, 2021
1 parent 6d2e0a2 commit 6860fbd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export default class AvatarComponent extends React.Component<Props> {
getChildContext(): {
optionContext: OptionContext;
};
componentWillMount(): void;
componentWillReceiveProps(nextProps: Props): void;
UNSAFE_componentWillMount(): void;
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
render(): JSX.Element;
private updateOptionContext;
}
Expand All @@ -44,8 +44,8 @@ export declare class Piece extends React.Component<Props> {
getChildContext(): {
optionContext: OptionContext;
};
componentWillMount(): void;
componentWillReceiveProps(nextProps: Props): void;
UNSAFE_componentWillMount(): void;
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
render(): JSX.Element;
private updateOptionContext;
}
8 changes: 4 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ var AvatarComponent = /** @class */ (function (_super) {
AvatarComponent.prototype.getChildContext = function () {
return { optionContext: this.optionContext };
};
AvatarComponent.prototype.componentWillMount = function () {
AvatarComponent.prototype.UNSAFE_componentWillMount = function () {
this.updateOptionContext(this.props);
};
AvatarComponent.prototype.componentWillReceiveProps = function (nextProps) {
AvatarComponent.prototype.UNSAFE_componentWillReceiveProps = function (nextProps) {
this.updateOptionContext(nextProps);
};
AvatarComponent.prototype.render = function () {
Expand Down Expand Up @@ -76,10 +76,10 @@ var Piece = /** @class */ (function (_super) {
Piece.prototype.getChildContext = function () {
return { optionContext: this.optionContext };
};
Piece.prototype.componentWillMount = function () {
Piece.prototype.UNSAFE_componentWillMount = function () {
this.updateOptionContext(this.props);
};
Piece.prototype.componentWillReceiveProps = function (nextProps) {
Piece.prototype.UNSAFE_componentWillReceiveProps = function (nextProps) {
this.updateOptionContext(nextProps);
};
Piece.prototype.render = function () {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "avataaars",
"version": "1.2.2",
"description": "React component for avataaars ",
"version": "2.0.0",
"description": "React component for avataaars",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ export default class AvatarComponent extends React.Component<Props> {
return { optionContext: this.optionContext }
}

componentWillMount () {
UNSAFE_componentWillMount () {
this.updateOptionContext(this.props)
}

componentWillReceiveProps (nextProps: Props) {
UNSAFE_componentWillReceiveProps (nextProps: Props) {
this.updateOptionContext(nextProps)
}

Expand Down Expand Up @@ -76,11 +76,11 @@ export class Piece extends React.Component<Props> {
return { optionContext: this.optionContext }
}

componentWillMount () {
UNSAFE_componentWillMount () {
this.updateOptionContext(this.props)
}

componentWillReceiveProps (nextProps: Props) {
UNSAFE_componentWillReceiveProps (nextProps: Props) {
this.updateOptionContext(nextProps)
}

Expand Down

0 comments on commit 6860fbd

Please sign in to comment.