@uncinc/uncinc-react-kitchen-sink 2.11.9 → 2.11.11

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.
@@ -6,7 +6,7 @@ declare namespace Image {
6
6
  alt: PropTypes.Requireable<string>;
7
7
  src: PropTypes.Validator<{}>;
8
8
  lazyload: PropTypes.Requireable<boolean>;
9
- aspectRatio: PropTypes.Requireable<number>;
9
+ aspectRatio: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
10
10
  objectFit: PropTypes.Requireable<string>;
11
11
  resizeDelay: PropTypes.Requireable<number>;
12
12
  };
@@ -23,7 +23,7 @@ var Image = function Image(props) {
23
23
  Image.propTypes = _objectSpread({
24
24
  src: PropTypes.oneOfType([PropTypes.string, ImmutablePropTypes.map, PropTypes.arrayOf(PropTypes.string)]).isRequired,
25
25
  lazyload: PropTypes.bool,
26
- aspectRatio: PropTypes.number,
26
+ aspectRatio: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
27
27
  objectFit: PropTypes.oneOf(['fill', 'contain', 'cover', 'none', 'scale-down']),
28
28
  resizeDelay: PropTypes.number
29
29
  }, Picture.propTypes);
@@ -1 +1,3 @@
1
- export default function usePrevious<T>(value: T): T | undefined;
1
+ type Value<T> = T | null | undefined;
2
+ export default function usePrevious<T>(value: T): Value<T>;
3
+ export {};
@@ -1,8 +1,10 @@
1
- import { useEffect, useRef } from 'react';
1
+ import { useRef } from 'react';
2
2
  export default function usePrevious(value) {
3
- var ref = useRef();
4
- useEffect(function () {
5
- ref.current = value;
6
- }, [value]);
7
- return ref.current;
3
+ var previous = useRef(undefined);
4
+ var current = useRef(undefined);
5
+ if (value !== current.current) {
6
+ previous.current = current.current;
7
+ current.current = value;
8
+ }
9
+ return previous.current;
8
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uncinc/uncinc-react-kitchen-sink",
3
- "version": "2.11.9",
3
+ "version": "2.11.11",
4
4
  "description": "Default React components that are easily extended.",
5
5
  "author": "uncinc",
6
6
  "license": "MIT",