Skip to content

Commit 4c98cac

Browse files
committed
unsafe
1 parent 69f6eb6 commit 4c98cac

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

lib/internal/hoc/withResaga.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ const resaga = (originConfigs) => (Component) => {
1717

1818

1919
class Resaga extends React.PureComponent {
20-
componentWillMount = () => {
20+
// eslint-disable-next-line camelcase
21+
UNSAFE_componentWillMount = () => {
2122
utils.config.set(configs.name, configs);
2223
const {
2324
setValue, setValueWithFunc,
@@ -43,7 +44,8 @@ const resaga = (originConfigs) => (Component) => {
4344
this.values = helpers.exportValues({ props: this.props, configs });
4445
};
4546

46-
componentWillReceiveProps = (nextProps) => {
47+
// eslint-disable-next-line camelcase
48+
UNSAFE_componentWillReceiveProps = (nextProps) => {
4749
if (debug.on()) {
4850
// eslint-disable-next-line react/destructuring-assignment
4951
const name = `${this.internalProps.Component.name}${this.props.id ? `[${this.props.id}]` : ''}`;
@@ -52,7 +54,8 @@ const resaga = (originConfigs) => (Component) => {
5254
};
5355

5456

55-
componentWillUpdate = (nextProps) => {
57+
// eslint-disable-next-line camelcase
58+
UNSAFE_componentWillUpdate = (nextProps) => {
5659
const changes = helpers.getValuesChanged(this.values, nextProps, this.internalProps);
5760
if (changes) {
5861
this.values = { ...this.values, ...changes };

lib/internal/hoc/withSimplifyResaga.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import helpers from './helpers';
1010

1111
const simplifyResaga = (configs) => (Component) => {
1212
class SimplifyResaga extends PureComponent {
13-
componentWillMount = () => {
13+
// eslint-disable-next-line camelcase
14+
UNSAFE_componentWillMount = () => {
1415
const {
1516
setValue, setValueWithFunc,
1617
beforeDispatch,
@@ -33,16 +34,17 @@ const simplifyResaga = (configs) => (Component) => {
3334
this.values = helpers.exportValues({ props: this.props, configs });
3435
};
3536

36-
componentWillReceiveProps = (nextProps) => {
37+
// eslint-disable-next-line camelcase
38+
UNSAFE_componentWillReceiveProps = (nextProps) => {
3739
if (debug.on()) {
3840
// eslint-disable-next-line react/destructuring-assignment
3941
const name = `${this.internalProps.Component.name}${this.props.id ? `[${this.props.id}]` : ''}`;
4042
debugs.componentWillReceiveProps(name, this.props, nextProps);
4143
}
4244
};
4345

44-
45-
componentWillUpdate = (nextProps) => {
46+
// eslint-disable-next-line camelcase
47+
UNSAFE_componentWillUpdate = (nextProps) => {
4648
const changes = helpers.getValuesChanged(this.values, nextProps, this.internalProps);
4749
if (changes) {
4850
this.values = { ...this.values, ...changes };

0 commit comments

Comments
 (0)