victory-chart 38.0.0 → 38.0.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # victory-chart
2
2
 
3
+ ## 38.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#3156](https://github.com/FormidableLabs/victory/pull/3156) [`974becf`](https://github.com/FormidableLabs/victory/commit/974becfcea43beab7f345f1246b831ef44deb1d0) - Fix charts on React 19: Victory reads props from child elements (and props like `labelComponent`) before React renders them, and React 19's JSX runtime no longer adds a class component's `defaultProps` to `element.props`. Charts lost defaults such as `data`, `samples` and VictoryLegend's `titleComponent` (missing bars, wrong lines, a `TypeError` with a titled legend), and VictoryBrushLine lost its width as an `axisComponent`. Victory now adds the missing defaults itself, as React 18 did. Adds `Helpers.getElementProps` and `Helpers.withDefaultProps` to `victory-core`.
8
+
3
9
  ## 38.0.0
4
10
 
5
11
  ### Major Changes
@@ -34,7 +34,7 @@ const defaultProps = {
34
34
  theme: victory_core.VictoryTheme.grayscale
35
35
  };
36
36
  const VictoryChartImpl = (initialProps) => {
37
- const propsWithDefaults = react.default.useMemo(() => (0, lodash_defaults.default)({}, initialProps, defaultProps), [initialProps]);
37
+ const propsWithDefaults = react.default.useMemo(() => (0, lodash_defaults.default)({ children: victory_core.Helpers.withDefaultProps(initialProps.children) }, initialProps, defaultProps), [initialProps]);
38
38
  const role = "chart";
39
39
  const { getAnimationProps, setAnimationState, getProps } = victory_core.Hooks.useAnimationState();
40
40
  const props = getProps(propsWithDefaults);
@@ -29,7 +29,7 @@ const defaultProps = {
29
29
  theme: VictoryTheme.grayscale
30
30
  };
31
31
  const VictoryChartImpl = (initialProps) => {
32
- const propsWithDefaults = React.useMemo(() => defaults({}, initialProps, defaultProps), [initialProps]);
32
+ const propsWithDefaults = React.useMemo(() => defaults({ children: Helpers.withDefaultProps(initialProps.children) }, initialProps, defaultProps), [initialProps]);
33
33
  const role = "chart";
34
34
  const { getAnimationProps, setAnimationState, getProps } = Hooks.useAnimationState();
35
35
  const props = getProps(propsWithDefaults);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "victory-chart",
3
- "version": "38.0.0",
3
+ "version": "38.0.1",
4
4
  "description": "Chart Component for Victory",
5
5
  "keywords": [
6
6
  "data visualization",
@@ -33,10 +33,10 @@
33
33
  "dependencies": {
34
34
  "lodash": "^4.17.19",
35
35
  "react-fast-compare": "^3.2.0",
36
- "victory-axis": "38.0.0",
37
- "victory-core": "38.0.0",
38
- "victory-polar-axis": "38.0.0",
39
- "victory-shared-events": "38.0.0"
36
+ "victory-axis": "38.0.1",
37
+ "victory-core": "38.0.1",
38
+ "victory-polar-axis": "38.0.1",
39
+ "victory-shared-events": "38.0.1"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "react": ">=18"