diff --git a/.gitignore b/.gitignore index c8f50f7c..97d22ec9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ npm-debug.log +node_modules/ +.idea/ \ No newline at end of file diff --git a/README.md b/README.md index b838a061..a6437157 100644 --- a/README.md +++ b/README.md @@ -103,10 +103,8 @@ var CustomTabBar = React.createClass({ var isTabActive = this.props.activeTab === page; return ( - this.props.goToPage(page)}> - - {name} - + this.props.goToPage(page)} style={[styles.tab]}> + {name} ); }, diff --git a/examples/FacebookTabsExample/FacebookTabBar.js b/examples/FacebookTabsExample/FacebookTabBar.js index 4c16e4fb..17cbba41 100644 --- a/examples/FacebookTabsExample/FacebookTabBar.js +++ b/examples/FacebookTabsExample/FacebookTabBar.js @@ -47,13 +47,11 @@ var FacebookTabBar = React.createClass({ console.log(name); return ( - this.props.goToPage(page)}> - - { this.selectedTabIcons[page] = icon }}/> - { this.unselectedTabIcons[page] = icon }}/> - + this.props.goToPage(page)} style={[styles.tab]}> + { this.selectedTabIcons[page] = icon }}/> + { this.unselectedTabIcons[page] = icon }}/> ); }, @@ -62,11 +60,16 @@ var FacebookTabBar = React.createClass({ var currentPage = this.props.activeTab; this.unselectedTabIcons.forEach((icon, i) => { + var iconRef = icon; + + if(!icon.setNativeProps && icon !== null) { + iconRef = icon.refs.icon_image + } if (value - i >= 0 && value - i <= 1) { - icon.setNativeProps({opacity: value - i}); + iconRef.setNativeProps({opacity: value - i}); } if (i - value >= 0 && i - value <= 1) { - icon.setNativeProps({opacity: i - value}); + iconRef.setNativeProps({opacity: i - value}); } }); }, diff --git a/examples/FacebookTabsExample/package.json b/examples/FacebookTabsExample/package.json index 15ad500b..0f3fd1b7 100644 --- a/examples/FacebookTabsExample/package.json +++ b/examples/FacebookTabsExample/package.json @@ -6,7 +6,7 @@ "start": "node_modules/react-native/packager/packager.sh" }, "dependencies": { - "react-native": "0.8.0", + "react-native": "0.9.0", "react-native-icons": "^0.2.0", "react-native-scrollable-tab-view": "^0.1.10" } diff --git a/examples/RugbyExample/ScrollingTabBar.js b/examples/RugbyExample/ScrollingTabBar.js index d9b602be..1acb5677 100644 --- a/examples/RugbyExample/ScrollingTabBar.js +++ b/examples/RugbyExample/ScrollingTabBar.js @@ -47,10 +47,8 @@ var ScrollingTabBar = React.createClass({ extrapolate: 'clamp'}); return ( - this.props.goToPage(page)}> - - {name} - + this.props.goToPage(page)} style={[styles.tab]}> + {name} ); }, diff --git a/examples/RugbyExample/package.json b/examples/RugbyExample/package.json index bb6ea60b..d9fc806c 100644 --- a/examples/RugbyExample/package.json +++ b/examples/RugbyExample/package.json @@ -6,6 +6,6 @@ "start": "node_modules/react-native/packager/packager.sh" }, "dependencies": { - "react-native": "^0.8.0" + "react-native": "^0.9.0" } } diff --git a/package.json b/package.json index a62fd9ad..57048f2d 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ }, "homepage": "https://github.com/brentvatne/react-native-scrollable-tab-view#readme", "peerDependencies": { - "react-native": ">=0.8.0 || 0.8.0-rc || 0.8.0-rc.2 || 0.9.0-rc || 0.10.0-rc" + "react-native": ">=0.9.0 || 0.9.0-rc || 0.10.0-rc || 0.11.0-rc" }, "dependencies": { "rebound": "0.0.13"