Skip to content

Conversation

@jbeard4
Copy link

@jbeard4 jbeard4 commented Feb 15, 2018

What I expect to happen:

  • first componentWillUpdate is called, such that old and new props are different
  • then render() is called with the new props, if componentShouldUpdate is true.

What actually happens:

  • first render() is called with the new props.
  • then componentWillUpdate is called such that old and new props are the same.

This is because debounce is deferring execution of
componentWillReceiveProps, thus breaking react component lifecycle
(which is described here:
https://busypeoples.github.io/post/react-component-lifecycle/).

What I expect to happen:
* first componentWillUpdate is called, such that old and new props are
* different
* then render() is called with the new props, if componentShouldUpdate
* is true.

What actually happens:

* first render() is called with the new props.
* then componentWillUpdate is called such that old and new props are the
* same.

This is because debounce is deferring execution of
componentWillReceiveProps, thus breaking react component lifecycle
(which is described here:
https://busypeoples.github.io/post/react-component-lifecycle/).
@scniro
Copy link

scniro commented Feb 18, 2018

@jbeard4 This library is pretty much abandoned. Have you've glimpsed at the plethora of issues? I wrote react-codemirror2 and have been actively maintaining it because of the frustrations I've encountered here. Not to mention the lack of tests, heavy dependencies, ancient documentation, etc. I am shocked people are still grasping on to this library...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants