Browse Source

Render children and pass props to children (#1159)

Render children and pass props to children
Export SharedElementTransition on iOS
Omit children from passed props
Guy Carmeli 7 years ago
parent
commit
b1f5cfefbb
2 changed files with 13 additions and 4 deletions
  1. 3
    2
      src/deprecated/indexDeprecated.ios.js
  2. 10
    2
      src/views/sharedElementTransition.ios.js

+ 3
- 2
src/deprecated/indexDeprecated.ios.js View File

1
 import Navigation from './../Navigation';
1
 import Navigation from './../Navigation';
2
 import {NavigationToolBarIOS} from './controllers';
2
 import {NavigationToolBarIOS} from './controllers';
3
+import SharedElementTransition from '../views/sharedElementTransition';
3
 
4
 
4
 module.exports = {
5
 module.exports = {
5
   Navigation,
6
   Navigation,
6
-  NavigationToolBarIOS
7
+  NavigationToolBarIOS,
8
+  SharedElementTransition
7
 };
9
 };
8
-

+ 10
- 2
src/views/sharedElementTransition.ios.js View File

1
 import React, {Component} from 'react';
1
 import React, {Component} from 'react';
2
 import {
2
 import {
3
-  requireNativeComponent,
4
   View
3
   View
5
 } from 'react-native';
4
 } from 'react-native';
6
 
5
 
7
 export default class SharedElementTransition extends Component {
6
 export default class SharedElementTransition extends Component {
7
+  static propTypes = {
8
+    children: PropTypes.object
9
+  };
10
+
8
   render() {
11
   render() {
9
-    return <View />;
12
+    const {children, ...restProps} = this.props;
13
+    return (
14
+      <View {...restProps}>
15
+        {children}
16
+      </View>
17
+    );
10
   }
18
   }
11
 }
19
 }