@jobber/components 6.23.1 → 6.23.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.
|
@@ -24,11 +24,6 @@ function SegmentedControlProvider({ children, selectedValue, onSelectValue, defa
|
|
|
24
24
|
const currentSelectedOption = isControlled
|
|
25
25
|
? selectedValue
|
|
26
26
|
: internalSelectedValue;
|
|
27
|
-
React.useEffect(() => {
|
|
28
|
-
if (isControlled && currentSelectedOption !== undefined) {
|
|
29
|
-
onSelectValue === null || onSelectValue === void 0 ? void 0 : onSelectValue(currentSelectedOption);
|
|
30
|
-
}
|
|
31
|
-
}, []);
|
|
32
27
|
return (React.createElement(SegmentedControlContext.Provider, { value: {
|
|
33
28
|
handleChange,
|
|
34
29
|
selectedValue: currentSelectedOption,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { createContext, useContext, useState, useCallback,
|
|
1
|
+
import React, { createContext, useContext, useState, useCallback, useMemo, useId, forwardRef, Children, useRef } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
|
|
4
4
|
const SegmentedControlContext = createContext({
|
|
@@ -22,11 +22,6 @@ function SegmentedControlProvider({ children, selectedValue, onSelectValue, defa
|
|
|
22
22
|
const currentSelectedOption = isControlled
|
|
23
23
|
? selectedValue
|
|
24
24
|
: internalSelectedValue;
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
if (isControlled && currentSelectedOption !== undefined) {
|
|
27
|
-
onSelectValue === null || onSelectValue === void 0 ? void 0 : onSelectValue(currentSelectedOption);
|
|
28
|
-
}
|
|
29
|
-
}, []);
|
|
30
25
|
return (React.createElement(SegmentedControlContext.Provider, { value: {
|
|
31
26
|
handleChange,
|
|
32
27
|
selectedValue: currentSelectedOption,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "6.23.
|
|
3
|
+
"version": "6.23.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -489,5 +489,5 @@
|
|
|
489
489
|
"> 1%",
|
|
490
490
|
"IE 10"
|
|
491
491
|
],
|
|
492
|
-
"gitHead": "
|
|
492
|
+
"gitHead": "3f16b3b782378b489c4813780ce1858c27ebb486"
|
|
493
493
|
}
|