New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-frame-component

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-frame-component - npm Package Compare versions

Comparing version 5.0.1 to 5.1.0

6

lib/Context.js

@@ -6,3 +6,3 @@ 'use strict';

});
exports.FrameContextConsumer = exports.FrameContextProvider = exports.FrameContext = undefined;
exports.FrameContextConsumer = exports.FrameContextProvider = exports.useFrame = exports.FrameContext = undefined;

@@ -26,2 +26,6 @@ var _react = require('react');

var useFrame = exports.useFrame = function useFrame() {
return _react2.default.useContext(FrameContext);
};
var FrameContextProvider = FrameContext.Provider,

@@ -28,0 +32,0 @@ FrameContextConsumer = FrameContext.Consumer;

@@ -6,3 +6,3 @@ 'use strict';

});
exports.FrameContextConsumer = exports.FrameContext = undefined;
exports.useFrame = exports.FrameContextConsumer = exports.FrameContext = undefined;

@@ -23,2 +23,8 @@ var _Context = require('./Context');

});
Object.defineProperty(exports, 'useFrame', {
enumerable: true,
get: function get() {
return _Context.useFrame;
}
});

@@ -25,0 +31,0 @@ var _Frame = require('./Frame');

2

package.json
{
"name": "react-frame-component",
"version": "5.0.1",
"version": "5.1.0",
"description": "React component to wrap your application or component in an iFrame for encapsulation purposes",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -79,4 +79,6 @@ # React <Frame /> component

###### Accessing the iframe's window and document
The iframe's `window` and `document` may be accessed via the FrameContextConsumer.
The iframe's `window` and `document` may be accessed via the `FrameContextConsumer` or the `useFrame` hook.
The example with `FrameContextConsumer`:
```js

@@ -100,2 +102,21 @@ import Frame, { FrameContextConsumer } from 'react-frame-component'

The example with `useFrame` hook:
```js
import Frame, { useFrame } from 'react-frame-component';
const InnerComponent = () => {
// Hook returns iframe's window and document instances from Frame context
const { document, window } = useFrame();
return null;
};
const OuterComponent = () => (
<Frame>
<InnerComponent />
</Frame>
);
```
## More info

@@ -102,0 +123,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc