@vitus-labs/coolgrid 2.0.0-beta.4 → 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.
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ALIGN_CONTENT_MAP_X, Provider, context, extendCss, makeItResponsive, value } from "@vitus-labs/unistyle";
2
2
  import { createContext, useContext, useMemo } from "react";
3
- import { config, get, omit, pick } from "@vitus-labs/core";
3
+ import { config, get, omit, pick, useStableValue } from "@vitus-labs/core";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
 
6
6
  //#region src/constants.ts
@@ -49,13 +49,13 @@ const getGridContext = (props = {}, theme = {}) => ({
49
49
  });
50
50
  const useGridContext = (props) => {
51
51
  const { theme } = useContext(context);
52
+ const stableCtxProps = useStableValue(pickThemeProps(props, CONTEXT_KEYS));
52
53
  return useMemo(() => {
53
- const ctxProps = pickThemeProps(props, CONTEXT_KEYS);
54
54
  return {
55
- ...getGridContext(ctxProps, theme),
56
- ...ctxProps
55
+ ...getGridContext(stableCtxProps, theme),
56
+ ...stableCtxProps
57
57
  };
58
- }, [props, theme]);
58
+ }, [stableCtxProps, theme]);
59
59
  };
60
60
 
61
61
  //#endregion
@@ -1,6 +1,6 @@
1
1
  import { ALIGN_CONTENT_MAP_X, Provider, context, extendCss, makeItResponsive, value } from "@vitus-labs/unistyle";
2
2
  import { createContext, useCallback, useContext, useMemo, useState } from "react";
3
- import { config, get, omit, pick } from "@vitus-labs/core";
3
+ import { config, get, omit, pick, useStableValue } from "@vitus-labs/core";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
 
6
6
  //#region src/constants.ts
@@ -49,13 +49,13 @@ const getGridContext = (props = {}, theme = {}) => ({
49
49
  });
50
50
  const useGridContext = (props) => {
51
51
  const { theme } = useContext(context);
52
+ const stableCtxProps = useStableValue(pickThemeProps(props, CONTEXT_KEYS));
52
53
  return useMemo(() => {
53
- const ctxProps = pickThemeProps(props, CONTEXT_KEYS);
54
54
  return {
55
- ...getGridContext(ctxProps, theme),
56
- ...ctxProps
55
+ ...getGridContext(stableCtxProps, theme),
56
+ ...stableCtxProps
57
57
  };
58
- }, [props, theme]);
58
+ }, [stableCtxProps, theme]);
59
59
  };
60
60
 
61
61
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitus-labs/coolgrid",
3
- "version": "2.0.0-beta.4",
3
+ "version": "2.1.0",
4
4
  "license": "MIT",
5
5
  "author": "Vit Bokisch <vit@bokisch.cz>",
6
6
  "maintainers": [
@@ -62,8 +62,8 @@
62
62
  "version": "node ../../scripts/sync-peer-deps.mjs"
63
63
  },
64
64
  "peerDependencies": {
65
- "@vitus-labs/core": "2.0.0-beta.4",
66
- "@vitus-labs/unistyle": "2.0.0-beta.4",
65
+ "@vitus-labs/core": "2.1.0",
66
+ "@vitus-labs/unistyle": "2.1.0",
67
67
  "react": ">= 19",
68
68
  "react-native": ">= 0.76"
69
69
  },
@@ -74,9 +74,9 @@
74
74
  },
75
75
  "devDependencies": {
76
76
  "@vitus-labs/core": "workspace:*",
77
- "@vitus-labs/tools-rolldown": "2.2.0",
78
- "@vitus-labs/tools-storybook": "2.2.0",
79
- "@vitus-labs/tools-typescript": "2.1.0",
77
+ "@vitus-labs/tools-rolldown": "2.3.0",
78
+ "@vitus-labs/tools-storybook": "2.3.0",
79
+ "@vitus-labs/tools-typescript": "2.3.0",
80
80
  "@vitus-labs/unistyle": "workspace:*",
81
81
  "react-native": ">=0.84.1"
82
82
  }