@cleanweb/react 2.1.1-beta.1 → 2.1.1-beta.2

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.
@@ -74,15 +74,15 @@ var useMethods = function () {
74
74
  'all clean-react hooks receive the same class object on every render.'
75
75
  ].join());
76
76
  var oldInstance = instanceRef.current;
77
- var hmrPreserveKeys = __spreadArray(__spreadArray([], ((_a = latestInstance._hmrPreserveKeys) !== null && _a !== void 0 ? _a : []), true), [
78
- 'state', 'props', 'hooks',
77
+ var hmrPreserveKeys = __spreadArray(__spreadArray([], latestInstance._hmrPreserveKeys, true), [
78
+ 'state', 'props',
79
79
  ], false);
80
80
  hmrPreserveKeys.forEach(function (_key) {
81
81
  var key = _key;
82
82
  // @ts-expect-error We're assigning to readonly properties. Also, Typescript doesn't know that the type of the left and right side will always match, due to the dynamic access.
83
83
  latestInstance[key] = oldInstance[key];
84
84
  });
85
- latestInstance._onHmrUpdate(oldInstance);
85
+ (_a = latestInstance._onHmrUpdate) === null || _a === void 0 ? void 0 : _a.call(latestInstance, oldInstance);
86
86
  Reflect.ownKeys(oldInstance).forEach(function (_key) {
87
87
  var key = _key;
88
88
  delete oldInstance[key];
@@ -59,12 +59,12 @@ exports.ComponentLogic = ComponentLogic;
59
59
  * The class argument must be a subclass of {@link ComponentLogic}.
60
60
  */
61
61
  var useLogic = function () {
62
- var _a;
62
+ var _a, _b;
63
63
  var args = [];
64
64
  for (var _i = 0; _i < arguments.length; _i++) {
65
65
  args[_i] = arguments[_i];
66
66
  }
67
- var Logic = args[0], _b = args[1], props = _b === void 0 ? {} : _b;
67
+ var Logic = args[0], _c = args[1], props = _c === void 0 ? {} : _c;
68
68
  // In production, we only use the latestInstance the first time, and it's ignored every other time.
69
69
  // This means changing the class at runtime will have no effect in production.
70
70
  // latestInstance is only extracted into a separate variable for use in dev mode during HMR.
@@ -90,7 +90,7 @@ var useLogic = function () {
90
90
  // @ts-expect-error We're assigning to readonly properties. Also, Typescript doesn't know that the type of the left and right side will always match, due to the dynamic access.
91
91
  latestInstance[key] = oldInstance_1[key];
92
92
  });
93
- latestInstance._onHmrUpdate(oldInstance_1);
93
+ (_a = latestInstance._onHmrUpdate) === null || _a === void 0 ? void 0 : _a.call(latestInstance, oldInstance_1);
94
94
  instanceRef.current = latestInstance;
95
95
  Reflect.ownKeys(oldInstance_1).forEach(function (_key) {
96
96
  var key = _key;
@@ -115,7 +115,7 @@ var useLogic = function () {
115
115
  // @ts-expect-error
116
116
  self.state = (_stateProxy = (0, state_1.useCleanState)(self.getInitialState, props));
117
117
  // @ts-expect-error
118
- self.hooks = (_hooksProxy = (_a = self.useHooks()) !== null && _a !== void 0 ? _a : {});
118
+ self.hooks = (_hooksProxy = (_b = self.useHooks()) !== null && _b !== void 0 ? _b : {});
119
119
  return self;
120
120
  };
121
121
  exports.useLogic = useLogic;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleanweb/react",
3
- "version": "2.1.1-beta.1",
3
+ "version": "2.1.1-beta.2",
4
4
  "description": "A suite of helpers for writing cleaner React function components.",
5
5
  "engines": {
6
6
  "node": ">=18"