UNPKG

scichart-react

Version:

React wrapper for SciChart JS

31 lines 1.16 kB
"use strict"; "use client"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DefaultFallback = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const react_1 = require("react"); const scichart_1 = require("scichart"); const DefaultFallback = () => { const rootRef = (0, react_1.useRef)(null); (0, react_1.useEffect)(() => { const rootElement = rootRef.current; const loader = new scichart_1.DefaultSciChartLoader(); const loaderDiv = loader.addChartLoader(rootElement, scichart_1.SciChartSurfaceBase.DEFAULT_THEME); return () => { if (rootElement) { loader.removeChartLoader(rootElement, loaderDiv); } }; }, []); return ((0, jsx_runtime_1.jsx)("div", { ref: rootRef, style: { position: "absolute", height: "100%", width: "100%", top: 0, left: 0, textAlign: "center", background: scichart_1.SciChartSurfaceBase.DEFAULT_THEME.sciChartBackground } })); }; exports.DefaultFallback = DefaultFallback; //# sourceMappingURL=DefaultFallback.js.map