@vitus-labs/attrs 2.0.0 → 2.1.0

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.
Files changed (2) hide show
  1. package/lib/index.js +3 -2
  2. package/package.json +5 -5
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { compose, hoistNonReactStatics, isEmpty, omit, pick } from "@vitus-labs/core";
1
+ import { compose, hoistNonReactStatics, isEmpty, omit, pick, useStableValue } from "@vitus-labs/core";
2
2
  import { useImperativeHandle, useMemo, useRef } from "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
 
@@ -37,7 +37,8 @@ const createAttrsHOC = ({ attrs, priorityAttrs }) => {
37
37
  const attrsHoc = (WrappedComponent) => {
38
38
  const HOC = (allProps) => {
39
39
  const { ref, ...props } = allProps;
40
- const filteredProps = useMemo(() => removeUndefinedProps(props), [allProps]);
40
+ const stableProps = useStableValue(props);
41
+ const filteredProps = useMemo(() => removeUndefinedProps(stableProps), [stableProps]);
41
42
  return /* @__PURE__ */ jsx(WrappedComponent, { ...useMemo(() => {
42
43
  if (!hasAnyChain) return {
43
44
  $attrsRef: ref,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitus-labs/attrs",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "license": "MIT",
5
5
  "author": "Vit Bokisch <vit@bokisch.cz>",
6
6
  "maintainers": [
@@ -59,14 +59,14 @@
59
59
  "version": "node ../../scripts/sync-peer-deps.mjs"
60
60
  },
61
61
  "peerDependencies": {
62
- "@vitus-labs/core": "2.0.0",
62
+ "@vitus-labs/core": "2.1.0",
63
63
  "react": ">= 19"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@vitus-labs/core": "workspace:*",
67
67
  "@vitus-labs/elements": "workspace:*",
68
- "@vitus-labs/tools-rolldown": "2.2.0",
69
- "@vitus-labs/tools-storybook": "2.2.0",
70
- "@vitus-labs/tools-typescript": "2.1.0"
68
+ "@vitus-labs/tools-rolldown": "2.3.0",
69
+ "@vitus-labs/tools-storybook": "2.3.0",
70
+ "@vitus-labs/tools-typescript": "2.3.0"
71
71
  }
72
72
  }