@clutch-creator/bridge
Advanced tools
Comparing version 5.0.0-rc.8 to 5.0.0-rc.9
28
index.js
@@ -31,3 +31,3 @@ "use strict"; | ||
var _toConsumableArray = require("@swc/helpers/lib/_to_consumable_array.js").default; | ||
var _react = require("react"); | ||
var _react = /*#__PURE__*/ _interopRequireDefault(require("react")); | ||
var _classnames = /*#__PURE__*/ _interopRequireDefault(require("classnames")); | ||
@@ -85,4 +85,22 @@ "use client"; | ||
delete props["data-d"]; | ||
// Check if we're redering on server side | ||
if (!_react.default.useRef) { | ||
var getKey = _react.default.useCallback(function(_, childId, customKey) { | ||
return [ | ||
calculateScope(dataD), | ||
childId, | ||
customKey | ||
].join("#"); | ||
}, [ | ||
dataD | ||
]); | ||
// server side component | ||
return [ | ||
{}, | ||
getKey, | ||
props | ||
]; | ||
} | ||
// calculate owner scope id | ||
var ownerScopeIdRef = (0, _react.useRef)(null); | ||
var ownerScopeIdRef = _react.default.useRef(null); | ||
if (!ownerScopeIdRef.current) { | ||
@@ -108,3 +126,3 @@ ownerScopeIdRef.current = calculateScope(dataD) || String(instanceCounter); | ||
// drop reports logic | ||
(0, _react.useEffect)(function() { | ||
_react.default.useEffect(function() { | ||
if ((INSPECTOR === null || INSPECTOR === void 0 ? void 0 : INSPECTOR.cancelDropReports) && ownerScopeIdRef.current) { | ||
@@ -122,3 +140,3 @@ INSPECTOR.cancelDropReports(ownerScopeIdRef.current); | ||
// get key handler for children instances | ||
var getKey = (0, _react.useCallback)(function(childReport, childId, customKey) { | ||
var getKey1 = _react.default.useCallback(function(childReport, childId, customKey) { | ||
var key = [ | ||
@@ -138,3 +156,3 @@ ownerScopeIdRef.current, | ||
report, | ||
getKey, | ||
getKey1, | ||
props | ||
@@ -141,0 +159,0 @@ ]; |
{ | ||
"name": "@clutch-creator/bridge", | ||
"version": "5.0.0-rc.8", | ||
"version": "5.0.0-rc.9", | ||
"description": "Clutch Bridge", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
151962
358