Skip to content

Commit

Permalink
chore(mixed): renamed unsafe lifecycle methods
Browse files Browse the repository at this point in the history
Executed via `npx react-codemod rename-unsafe-lifecycles --parser babel`
Disabled lint issues for updated lines.

Closes Semantic-Org#3741
Related to Semantic-Org#2732
  • Loading branch information
Jørn Myrland committed Aug 15, 2019
1 parent 9bcc76a commit 5bb3e90
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/addons/TransitionablePortal/TransitionablePortal.js
Expand Up @@ -76,7 +76,8 @@ export default class TransitionablePortal extends Component {
// Lifecycle
// ----------------------------------------

componentWillReceiveProps({ open }) {
// eslint-disable-next-line camelcase
UNSAFE_componentWillReceiveProps({ open }) {
debug('componentWillReceiveProps()', { open })

this.setState({ portalOpen: open })
Expand Down
3 changes: 2 additions & 1 deletion src/behaviors/Visibility/Visibility.js
Expand Up @@ -188,7 +188,8 @@ export default class Visibility extends Component {
// Lifecycle
// ----------------------------------------

componentWillReceiveProps({ continuous, once, context, updateOn }) {
// eslint-disable-next-line camelcase
UNSAFE_componentWillReceiveProps({ continuous, once, context, updateOn }) {
const cleanHappened =
continuous !== this.props.continuous ||
once !== this.props.once ||
Expand Down
3 changes: 2 additions & 1 deletion src/lib/AutoControlledComponent.js
Expand Up @@ -162,7 +162,8 @@ export default class AutoControlledComponent extends Component {
this.state = { ...state, ...initialAutoControlledState }
}

componentWillReceiveProps(nextProps) {
// eslint-disable-next-line camelcase
UNSAFE_componentWillReceiveProps(nextProps) {
const { autoControlledProps } = this.constructor

// Solve the next state for autoControlledProps
Expand Down
8 changes: 5 additions & 3 deletions src/modules/Dropdown/Dropdown.js
Expand Up @@ -391,7 +391,8 @@ export default class Dropdown extends Component {
return { focus: false, searchQuery: '' }
}

componentWillMount() {
// eslint-disable-next-line camelcase
UNSAFE_componentWillMount() {
debug('componentWillMount()')
const { open, value } = this.state

Expand All @@ -403,8 +404,9 @@ export default class Dropdown extends Component {
}
}

componentWillReceiveProps(nextProps) {
super.componentWillReceiveProps(nextProps)
// eslint-disable-next-line camelcase
UNSAFE_componentWillReceiveProps(nextProps) {
super.UNSAFE_componentWillReceiveProps(nextProps)
debug('componentWillReceiveProps()')
debug('to props:', objectDiff(this.props, nextProps))

Expand Down
8 changes: 5 additions & 3 deletions src/modules/Search/Search.js
Expand Up @@ -191,16 +191,18 @@ export default class Search extends Component {
static Result = SearchResult
static Results = SearchResults

componentWillMount() {
// eslint-disable-next-line camelcase
UNSAFE_componentWillMount() {
debug('componentWillMount()')
const { open, value } = this.state

this.setValue(value)
if (open) this.open()
}

componentWillReceiveProps(nextProps) {
super.componentWillReceiveProps(nextProps)
// eslint-disable-next-line camelcase
UNSAFE_componentWillReceiveProps(nextProps) {
super.UNSAFE_componentWillReceiveProps(nextProps)
debug('componentWillReceiveProps()')
debug('changed props:', objectDiff(nextProps, this.props))

Expand Down
3 changes: 2 additions & 1 deletion src/modules/Sticky/Sticky.js
Expand Up @@ -104,7 +104,8 @@ export default class Sticky extends Component {
}
}

componentWillReceiveProps(nextProps) {
// eslint-disable-next-line camelcase
UNSAFE_componentWillReceiveProps(nextProps) {
const { active: current, scrollContext: currentScrollContext } = this.props
const { active: next, scrollContext: nextScrollContext } = nextProps

Expand Down
3 changes: 2 additions & 1 deletion src/modules/Transition/Transition.js
Expand Up @@ -120,7 +120,8 @@ export default class Transition extends Component {
this.updateStatus()
}

componentWillReceiveProps(nextProps) {
// eslint-disable-next-line camelcase
UNSAFE_componentWillReceiveProps(nextProps) {
debug('componentWillReceiveProps()')

const { current: status, next } = this.computeStatuses(nextProps)
Expand Down
3 changes: 2 additions & 1 deletion src/modules/Transition/TransitionGroup.js
Expand Up @@ -58,7 +58,8 @@ export default class TransitionGroup extends React.Component {
}
}

componentWillReceiveProps(nextProps) {
// eslint-disable-next-line camelcase
UNSAFE_componentWillReceiveProps(nextProps) {
debug('componentWillReceiveProps()')

const { children: prevMapping } = this.state
Expand Down

0 comments on commit 5bb3e90

Please sign in to comment.