浏览代码

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 年前
父节点
当前提交
b1f5cfefbb
共有 2 个文件被更改,包括 13 次插入4 次删除
  1. 3
    2
      src/deprecated/indexDeprecated.ios.js
  2. 10
    2
      src/views/sharedElementTransition.ios.js

+ 3
- 2
src/deprecated/indexDeprecated.ios.js 查看文件

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

+ 10
- 2
src/views/sharedElementTransition.ios.js 查看文件

@@ -1,11 +1,19 @@
1 1
 import React, {Component} from 'react';
2 2
 import {
3
-  requireNativeComponent,
4 3
   View
5 4
 } from 'react-native';
6 5
 
7 6
 export default class SharedElementTransition extends Component {
7
+  static propTypes = {
8
+    children: PropTypes.object
9
+  };
10
+
8 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
 }