Skip to content

Commit ae78009

Browse files
Felix Beceicjtomic-croz
Felix Beceic
authored andcommitted
Fix usePrevious export/import issue
1 parent dd0c87d commit ae78009

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

libs/upload/src/DragZone.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ import UploadDropZone from "@rpldy/upload-drop-zone";
2323
import { Field, FieldProps } from "@tiller-ds/form-elements";
2424
import { LoadingIcon } from "@tiller-ds/icons";
2525
import { ComponentTokens, cx, TokenProps, useIcon, useTokens } from "@tiller-ds/theme";
26+
import { usePrevious } from "@tiller-ds/util";
2627

2728
import UploadyWrapper, { UploadyWrapperProps } from "./UploadyWrapper";
2829

2930
import { UseFileUpload, File, defaultUploadResponseMapper } from "./useFileUpload";
3031
import { BatchItem } from "@rpldy/shared";
31-
import { usePrevious } from "../../util/src/usePrevious";
3232

3333
export type DragZoneProps<T extends File> = {
3434
/**

libs/util/src/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export type DisplayType = InternalDisplayType;
2424
export { default as useInterval } from "./useInterval";
2525
export { default as useTimeout } from "./useTimeout";
2626
export { default as useViewport } from "./useViewport";
27+
export { default as usePrevious } from "./usePrevious";
2728

2829
export { default as createNamedContext } from "./createNamedContext";
2930
export {

libs/util/src/usePrevious.tsx

+19
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
* Copyright 2023 CROZ d.o.o, the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
118
import { useEffect, useRef } from "react";
219

320
export const usePrevious = <T extends unknown>(value: T): T | undefined => {
@@ -7,3 +24,5 @@ export const usePrevious = <T extends unknown>(value: T): T | undefined => {
724
});
825
return ref.current;
926
};
27+
28+
export default usePrevious;

0 commit comments

Comments
 (0)