@remote-ui/react
Advanced tools
Comparing version 4.4.2 to 4.4.3
@@ -6,13 +6,3 @@ 'use strict'; | ||
var react = require('react'); | ||
var context = require('./context.js'); | ||
function useRemoteReceiver() { | ||
const receiver = react.useContext(context.RemoteReceiverContext); | ||
if (receiver == null) { | ||
throw new Error('No remote-ui Receiver instance found in context'); | ||
} | ||
return receiver; | ||
} | ||
function useAttached(receiver, attached) { | ||
@@ -100,2 +90,1 @@ const [state, setState] = react.useState({ | ||
exports.useAttached = useAttached; | ||
exports.useRemoteReceiver = useRemoteReceiver; |
@@ -10,4 +10,2 @@ 'use strict'; | ||
var controller = require('./controller.js'); | ||
var context = require('./context.js'); | ||
var hooks = require('./hooks.js'); | ||
@@ -24,5 +22,1 @@ | ||
exports.createController = controller.createController; | ||
exports.ControllerContext = context.ControllerContext; | ||
exports.RemoteReceiverContext = context.RemoteReceiverContext; | ||
exports.useAttached = hooks.useAttached; | ||
exports.useRemoteReceiver = hooks.useRemoteReceiver; |
import type { RemoteReceiver, RemoteReceiverAttachable } from '@remote-ui/core'; | ||
export declare function useController(): import("./types").Controller; | ||
export declare function useRemoteReceiver(): RemoteReceiver; | ||
export declare function useAttached<T extends RemoteReceiverAttachable>(receiver: RemoteReceiver, attached: T): T | null; | ||
//# sourceMappingURL=hooks.d.ts.map |
@@ -10,5 +10,3 @@ export type { RemoteReceiver } from '@remote-ui/core'; | ||
export type { ReactPropsFromRemoteComponentType, ReactComponentTypeFromRemoteComponentType, } from '../types'; | ||
export { RemoteReceiverContext, ControllerContext } from './context'; | ||
export { useRemoteReceiver, useAttached } from './hooks'; | ||
export type { Controller, RemoteComponentProps, RemoteTextProps } from './types'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -10,2 +10,6 @@ # Changelog | ||
## [4.4.3] | ||
- Removed some unused hooks and context ([pull request](https://github.com/Shopify/remote-ui/pull/145)) | ||
## [4.4.2] | ||
@@ -12,0 +16,0 @@ |
{ | ||
"name": "@remote-ui/react", | ||
"version": "4.4.2", | ||
"version": "4.4.3", | ||
"publishConfig": { | ||
@@ -47,3 +47,3 @@ "access": "public", | ||
}, | ||
"gitHead": "538b53a180eaf2b8dc41d9c8f316d6c2cb8c86e4" | ||
"gitHead": "d1f3f2a08d26dfe859f476776d3eb5aa202bad43" | ||
} |
@@ -1,26 +0,4 @@ | ||
import {useState, useDebugValue, useContext, useEffect} from 'react'; | ||
import {useState, useDebugValue, useEffect} from 'react'; | ||
import type {RemoteReceiver, RemoteReceiverAttachable} from '@remote-ui/core'; | ||
import {ControllerContext, RemoteReceiverContext} from './context'; | ||
export function useController() { | ||
const controller = useContext(ControllerContext); | ||
if (controller == null) { | ||
throw new Error('No remote-ui Controller instance found in context'); | ||
} | ||
return controller; | ||
} | ||
export function useRemoteReceiver() { | ||
const receiver = useContext(RemoteReceiverContext); | ||
if (receiver == null) { | ||
throw new Error('No remote-ui Receiver instance found in context'); | ||
} | ||
return receiver; | ||
} | ||
interface State<T extends RemoteReceiverAttachable> { | ||
@@ -27,0 +5,0 @@ receiver: RemoteReceiver; |
@@ -14,4 +14,2 @@ export type {RemoteReceiver} from '@remote-ui/core'; | ||
} from '../types'; | ||
export {RemoteReceiverContext, ControllerContext} from './context'; | ||
export {useRemoteReceiver, useAttached} from './hooks'; | ||
export type {Controller, RemoteComponentProps, RemoteTextProps} from './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
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
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
146088
103
2234