Skip to content

Commit

Permalink
fix: fixed crash with Animated.Image animated.Value transforms/opacity
Browse files Browse the repository at this point in the history
  • Loading branch information
IjzerenHein committed Nov 12, 2019
1 parent 6ed86c7 commit 0ee7970
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/SharedElementTransition.tsx
Expand Up @@ -133,23 +133,18 @@ export class SharedElementTransition extends React.Component<
> {
static prepareNode(node: SharedElementNode | null): any {
let nodeStyle: any = {};
if (node && node.parentInstance) {
if (Platform.OS === 'android' && node && node.parentInstance) {
const child = React.Children.only(node.parentInstance.props.children);
const props = child ? child.props : {};
nodeStyle = StyleSheet.flatten([props.style]) || {};
delete nodeStyle.transform;
delete nodeStyle.opacity;
nodeStyle.resizeMode = nodeStyle.resizeMode || props.resizeMode;
if (nodeStyle.backgroundColor) {
// $FlowFixMe
if (nodeStyle.backgroundColor)
nodeStyle.backgroundColor = processColor(nodeStyle.backgroundColor);
}
if (nodeStyle.borderColor) {
// $FlowFixMe
if (nodeStyle.borderColor)
nodeStyle.borderColor = processColor(nodeStyle.borderColor);
}
if (nodeStyle.color) {
// $FlowFixMe
nodeStyle.color = processColor(nodeStyle.color);
}
if (nodeStyle.color) nodeStyle.color = processColor(nodeStyle.color);
}
return node
? {
Expand Down

0 comments on commit 0ee7970

Please sign in to comment.