kitchen-simulator 4.1.0-react-18 → 4.1.1-react-18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.js +6 -2
- package/lib/index.js +6 -2
- package/package.json +1 -1
package/es/index.js
CHANGED
|
@@ -9,6 +9,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import { createRoot } from 'react-dom/client';
|
|
11
11
|
import LiteRenderer from "./LiteRenderer";
|
|
12
|
+
import { flushSync } from 'react-dom';
|
|
12
13
|
export function renderKitchenSimulator(container) {
|
|
13
14
|
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
14
15
|
var setExternalEventFn = null;
|
|
@@ -29,8 +30,11 @@ export function renderKitchenSimulator(container) {
|
|
|
29
30
|
return _createClass(Wrapper, [{
|
|
30
31
|
key: "setExternalEvent",
|
|
31
32
|
value: function setExternalEvent(newEvent) {
|
|
32
|
-
this
|
|
33
|
-
|
|
33
|
+
var _this2 = this;
|
|
34
|
+
flushSync(function () {
|
|
35
|
+
_this2.setState({
|
|
36
|
+
externalEvent: newEvent
|
|
37
|
+
});
|
|
34
38
|
});
|
|
35
39
|
}
|
|
36
40
|
}, {
|
package/lib/index.js
CHANGED
|
@@ -15,6 +15,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
15
15
|
var _react = _interopRequireDefault(require("react"));
|
|
16
16
|
var _client = require("react-dom/client");
|
|
17
17
|
var _LiteRenderer = _interopRequireDefault(require("./LiteRenderer"));
|
|
18
|
+
var _reactDom = require("react-dom");
|
|
18
19
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
19
20
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
21
|
function renderKitchenSimulator(container) {
|
|
@@ -37,8 +38,11 @@ function renderKitchenSimulator(container) {
|
|
|
37
38
|
return (0, _createClass2["default"])(Wrapper, [{
|
|
38
39
|
key: "setExternalEvent",
|
|
39
40
|
value: function setExternalEvent(newEvent) {
|
|
40
|
-
this
|
|
41
|
-
|
|
41
|
+
var _this2 = this;
|
|
42
|
+
(0, _reactDom.flushSync)(function () {
|
|
43
|
+
_this2.setState({
|
|
44
|
+
externalEvent: newEvent
|
|
45
|
+
});
|
|
42
46
|
});
|
|
43
47
|
}
|
|
44
48
|
}, {
|