opentok-react-native
Advanced tools
Comparing version 0.2.4 to 0.3.0
{ | ||
"name": "opentok-react-native", | ||
"version": "0.2.4", | ||
"version": "0.3.0", | ||
"description": "React Native components for OpenTok iOS and Android SDKs", | ||
@@ -29,3 +29,4 @@ "main": "src/index.js", | ||
"dependencies": { | ||
"underscore": "^1.8.3" | ||
"underscore": "^1.8.3", | ||
"prop-types": "^15.6.0" | ||
}, | ||
@@ -43,5 +44,4 @@ "devDependencies": { | ||
"react": "16.2.0", | ||
"react-native": "0.51.0", | ||
"prop-types": "^15.6.0" | ||
"react-native": "0.51.0" | ||
} | ||
} |
@@ -14,2 +14,3 @@ import React, { Component, Children, cloneElement } from 'react'; | ||
isConnected: false, | ||
sessionInfo: null, | ||
}; | ||
@@ -52,4 +53,7 @@ } | ||
.then(() => { | ||
this.setState({ | ||
isConnected: true, | ||
OT.getSessionInfo((sessionInfo) => { | ||
this.setState({ | ||
isConnected: true, | ||
sessionInfo, | ||
}); | ||
}); | ||
@@ -68,2 +72,3 @@ const signalData = sanitizeSignalData(this.props.signal); | ||
isConnected: false, | ||
sessionInfo: null, | ||
}); | ||
@@ -75,4 +80,7 @@ }) | ||
} | ||
getSessionInfo() { | ||
return this.state.sessionInfo; | ||
} | ||
render() { | ||
if (this.state.isConnected) { | ||
if (this.state.isConnected && this.props.children) { | ||
const childrenWithProps = Children.map( | ||
@@ -100,3 +108,3 @@ this.props.children, | ||
PropTypes.arrayOf(PropTypes.element), | ||
]).isRequired, | ||
]), | ||
eventHandlers: PropTypes.object, // eslint-disable-line react/forbid-prop-types | ||
@@ -103,0 +111,0 @@ signal: PropTypes.object, // eslint-disable-line react/forbid-prop-types |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
90473
11
700
2
+ Addedprop-types@^15.6.0
+ Addedjs-tokens@4.0.0(transitive)
+ Addedloose-envify@1.4.0(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedprop-types@15.8.1(transitive)
+ Addedreact-is@16.13.1(transitive)