@wixc3/react-board
Advanced tools
Comparing version 2.1.3 to 2.2.0
@@ -26,6 +26,19 @@ "use strict"; | ||
// react <18 | ||
await new Promise((resolve, reject) => { | ||
react_dom_1.default.render(react_1.default.createElement(ErrorBoundary, { reportError: reject }, element), container, resolve); | ||
}); | ||
return () => react_dom_1.default.unmountComponentAtNode(container); | ||
const cleanup = () => react_dom_1.default.unmountComponentAtNode(container); | ||
try { | ||
await new Promise((resolve, reject) => { | ||
react_dom_1.default.render(react_1.default.createElement(ErrorBoundary, { reportError: reject }, element), container, resolve); | ||
}); | ||
} | ||
catch (e) { | ||
/** | ||
* If an error occurs during ReactDOM.render(), React 17 will keep | ||
* _reactRootContainer property attached to the container DOM node. | ||
* This property points to an a stale fiber object, which prevents | ||
* subsequent ReactDOM.render() calls from working. | ||
*/ | ||
cleanup(); | ||
throw e; | ||
} | ||
return cleanup; | ||
} | ||
@@ -32,0 +45,0 @@ }; |
import type React from 'react'; | ||
import type { IRenderableLifeCycleHooks, IRenderableMetadataBase, OmitIRenderableMetadataBase } from '@wixc3/board-core'; | ||
export { BoardSetupFunction } from '@wixc3/board-core'; | ||
export declare type OmitReactBoard<DATA extends IReactBoard> = Omit<OmitIRenderableMetadataBase<DATA>, 'render' | 'cleanup' | 'props'>; | ||
export type OmitReactBoard<DATA extends IReactBoard> = Omit<OmitIRenderableMetadataBase<DATA>, 'render' | 'cleanup' | 'props'>; | ||
export interface IReactBoardHooks<PLUGINPROPS> extends IRenderableLifeCycleHooks<PLUGINPROPS> { | ||
@@ -11,7 +11,9 @@ wrapRender?: (props: PLUGINPROPS, renderable: IRenderableMetadataBase, renderableElement: JSX.Element, canvas: HTMLElement) => null | JSX.Element; | ||
name: string; | ||
/** | ||
* the board to render | ||
*/ | ||
/** An image URL to be used as the board's thumbnail. */ | ||
cover?: string; | ||
/** A list of tags. */ | ||
tags?: string[]; | ||
/** A React component representing the board. */ | ||
Board: React.ComponentType<any>; | ||
} | ||
//# sourceMappingURL=types.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var board_core_1 = require("@wixc3/board-core"); | ||
//# sourceMappingURL=types.js.map |
{ | ||
"name": "@wixc3/react-board", | ||
"description": "Library for creation of React component boards", | ||
"version": "2.1.3", | ||
"version": "2.2.0", | ||
"main": "dist/index.js", | ||
@@ -11,3 +11,3 @@ "peerDependencies": { | ||
"dependencies": { | ||
"@wixc3/board-core": "^2.1.3" | ||
"@wixc3/board-core": "^2.2.0" | ||
}, | ||
@@ -22,4 +22,4 @@ "files": [ | ||
"license": "MIT", | ||
"repository": "https://github.com/wixplosives/wcs-core/tree/master/packages/react-board", | ||
"homepage": "https://github.com/wixplosives/wcs-core", | ||
"repository": "https://github.com/wixplosives/codux-core/tree/master/packages/react-board", | ||
"homepage": "https://github.com/wixplosives/codux-core", | ||
"publishConfig": { | ||
@@ -26,0 +26,0 @@ "access": "public" |
@@ -5,3 +5,3 @@ # @wixc3/react-board | ||
Library for creation of React component boards. | ||
This library is here to help you create React component boards for Codux. | ||
@@ -8,0 +8,0 @@ ## Usage |
@@ -28,6 +28,10 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
/** | ||
* the board to render | ||
*/ | ||
/** An image URL to be used as the board's thumbnail. */ | ||
cover?: string; | ||
/** A list of tags. */ | ||
tags?: string[]; | ||
/** A React component representing the board. */ | ||
Board: React.ComponentType<any>; | ||
} |
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
18348
260
Updated@wixc3/board-core@^2.2.0