Skip to content

Conversation

eps1lon
Copy link
Owner

@eps1lon eps1lon commented Apr 11, 2019

Cherry-picking reactjs#468

Breaking

Callbacks that use argument spread or access arguments will not have acces to the DOM node. The DOM node is only passed if Function.prototype.length is greater than 0.

// no node passed
const noNodeCallback = () => {};
// node passed
const withNodeCallback = node => {};

The first callback enables strict mode compatible usage of Transition. If you expect the node in callbacks a call to findDOMNode is required which issues a warning in React.StrictMode.

@eps1lon eps1lon added enhancement New feature or request SemVer: Breaking labels Apr 11, 2019
@eps1lon eps1lon changed the title Feat/unnecessary find dom node breaking(Transition): Only call findDOMNode if necessary Apr 11, 2019
@eps1lon eps1lon merged commit e58ed36 into strict Apr 11, 2019
eps1lon added a commit that referenced this pull request Jun 19, 2019
* feat(Transition): Add findDOMNode prop

Useful for strict mode compatibility.

* test(Transition): Add test case for default findDOMNode

* test(Transition): Use jest.fn instead of sinon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request SemVer: Breaking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant