Skip to content

Commit f9a1aa3

Browse files
committed
StaticContainer
1 parent 8ed9770 commit f9a1aa3

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

SceneComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const ReactNative = require('react-native');
33
const {Component, } = React;
44
const {View, StyleSheet, } = ReactNative;
55

6-
const StaticContainer = require('react-static-container');
6+
const StaticContainer = require('./StaticContainer');
77

88
const SceneComponent = (Props) => {
99
const {shouldUpdated, ...props, } = Props;

StaticContainer.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
var React = require('React');
2+
3+
class StaticContainer extends React.Component {
4+
5+
shouldComponentUpdate(nextProps: Object): boolean {
6+
return !!nextProps.shouldUpdate;
7+
}
8+
9+
render(): ?ReactElement {
10+
var child = this.props.children;
11+
if (child === null || child === false) {
12+
return null;
13+
}
14+
return React.Children.only(child);
15+
}
16+
17+
}
18+
19+
module.exports = StaticContainer;

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
},
3030
"homepage": "https://github.com/brentvatne/react-native-scrollable-tab-view#readme",
3131
"dependencies": {
32-
"react-static-container": "^1.0.1",
3332
"react-timer-mixin": "^0.13.3"
3433
},
3534
"devDependencies": {

0 commit comments

Comments
 (0)