react-gateway
Advanced tools
Comparing version 2.7.0 to 2.8.0
@@ -67,4 +67,4 @@ 'use strict'; | ||
into: _propTypes2.default.string.isRequired, | ||
children: _propTypes2.default.oneOfType([_propTypes2.default.element, _propTypes2.default.string]) | ||
children: _propTypes2.default.node | ||
}; | ||
exports.default = Gateway; |
@@ -38,3 +38,3 @@ 'use strict'; | ||
_this.state = { | ||
child: null | ||
children: null | ||
}; | ||
@@ -41,0 +41,0 @@ |
{ | ||
"name": "react-gateway", | ||
"version": "2.7.0", | ||
"version": "2.8.0", | ||
"description": "Render React DOM into a new context", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -9,3 +9,4 @@ # React Gateway | ||
It also works in universal (isomorphic) React applications without any | ||
additional setup. | ||
additional setup and in React Native applications | ||
[when used correctly](#react-native-example). | ||
@@ -172,1 +173,40 @@ ## Installation | ||
update its internal registry and ensure things are properly rendered. | ||
## React Native example | ||
React Gateway does not directly depend on `react-dom`, so it works fine with | ||
React Native under one condition: | ||
**You must pass React Native component like `View` or similar to | ||
`component` prop of `<GatewayDest>`.** | ||
Because if you don't, `<GatewayDest>` will try to render `div` element, which | ||
is not available. | ||
```js | ||
import React from 'react'; | ||
import { Text, View } from 'react-native'; | ||
import { | ||
Gateway, | ||
GatewayDest, | ||
GatewayProvider | ||
} from 'react-gateway'; | ||
export default class Application extends React.Component { | ||
render() { | ||
return ( | ||
<GatewayProvider> | ||
<View> | ||
<Text>React Gateway Native Example</Text> | ||
<View> | ||
<Gateway into="one"> | ||
<Text>Text rendered elsewhere</Text> | ||
</Gateway> | ||
</View> | ||
<GatewayDest name="one" component={View} /> | ||
</View> | ||
</GatewayProvider> | ||
); | ||
} | ||
} | ||
``` |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
19949
211
0