You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
forward prop updates to children in Velociraptor with React.cloneElement
This commit is contained in:
@@ -68,7 +68,9 @@ module.exports = React.createClass({
|
|||||||
if (oldNode && oldNode.style.visibility == 'hidden' && c.props.style.visibility == 'visible') {
|
if (oldNode && oldNode.style.visibility == 'hidden' && c.props.style.visibility == 'visible') {
|
||||||
oldNode.style.visibility = c.props.style.visibility;
|
oldNode.style.visibility = c.props.style.visibility;
|
||||||
}
|
}
|
||||||
self.children[c.key] = old;
|
// clone the old element with the props (and children) of the new element
|
||||||
|
// so prop updates are still received by the children.
|
||||||
|
self.children[c.key] = React.cloneElement(old, c.props, c.props.children);
|
||||||
} else {
|
} else {
|
||||||
// new element. If we have a startStyle, use that as the style and go through
|
// new element. If we have a startStyle, use that as the style and go through
|
||||||
// the enter animations
|
// the enter animations
|
||||||
|
|||||||
Reference in New Issue
Block a user