Skip to content

Commit 4440e68

Browse files
author
Egor Didenko
committed
fix: renamed refUploadCtxProvider to apiRef
1 parent 71de0ff commit 4440e68

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

packages/react-uploader/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ import {FileUploaderRegular} from "@uploadcare/react-uploader";
103103

104104
## File Uploader API
105105

106-
For convenience, we provide the ability to access the File Uploader API using `refUploadCtxProvider`.
107-
You can see what methods are available in `refUploadCtxProvider` in the [documentation][uc-docs-file-uploader-api].
106+
For convenience, we provide the ability to access the File Uploader API using `apiRef`.
107+
You can see what methods are available in `apiRef` in the [documentation][uc-docs-file-uploader-api].
108108
It is important to note that we now pass all InstanceType from UploadCtxProvider.
109109

110110
```jsx
@@ -118,7 +118,7 @@ const Example = () => {
118118
const uploaderRef = useRef < InstanceType < UploadCtxProvider > | null > (null);
119119

120120

121-
<FileUploaderRegular refUploadCtxProvider={uploaderRef} pubkey="YOUR_PUBLIC_KEY"/>;
121+
<FileUploaderRegular apiRef={uploaderRef} pubkey="YOUR_PUBLIC_KEY"/>;
122122
}
123123
```
124124

packages/react-uploader/src/Uploader/Inline/FileUploaderInline.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const CSS_SRC_INLINE = getStyleSource("inline");
2020
export const FileUploaderInline: FC<TProps> = ({
2121
ctxName,
2222
className,
23-
refUploadCtxProvider,
23+
apiRef,
2424
...props
2525
}) => {
2626
const CTX_NAME = useMemo(() => ctxName ?? LR.UID.generate(), [ctxName]);
@@ -36,7 +36,7 @@ export const FileUploaderInline: FC<TProps> = ({
3636
<AdapterConfig userAgentIntegration={getUserAgentIntegration()} ctx-name={CTX_NAME} {...config} />
3737
{/* @ts-ignore */}
3838
<AdapterUploadCtxProvider
39-
ref={refUploadCtxProvider}
39+
ref={apiRef}
4040
ctx-name={CTX_NAME}
4141
{...eventHandlers}
4242
/>

packages/react-uploader/src/Uploader/Minimal/FileUploaderMinimal.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const CSS_SRC_MINIMAL = getStyleSource("minimal");
2121
export const FileUploaderMinimal: FC<TProps> = ({
2222
ctxName,
2323
className,
24-
refUploadCtxProvider,
24+
apiRef,
2525
...props
2626
}) => {
2727
const CTX_NAME = useMemo(() => ctxName ?? LR.UID.generate(), [ctxName]);
@@ -37,7 +37,7 @@ export const FileUploaderMinimal: FC<TProps> = ({
3737
<AdapterConfig userAgentIntegration={getUserAgentIntegration()} ctx-name={CTX_NAME} {...config} />
3838
{/* @ts-ignore */}
3939
<AdapterUploadCtxProvider
40-
ref={refUploadCtxProvider}
40+
ref={apiRef}
4141
ctx-name={CTX_NAME}
4242
{...eventHandlers}
4343
/>

packages/react-uploader/src/Uploader/Regular/FileUploaderRegular.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const CSS_SRC_REGULAR = getStyleSource("regular");
2222
export const FileUploaderRegular: FC<TProps> = ({
2323
ctxName,
2424
className,
25-
refUploadCtxProvider,
25+
apiRef,
2626
...props
2727
}) => {
2828
const CTX_NAME = useMemo(() => ctxName ?? LR.UID.generate(), [ctxName]);
@@ -38,7 +38,7 @@ export const FileUploaderRegular: FC<TProps> = ({
3838
<AdapterConfig userAgentIntegration={getUserAgentIntegration()} ctx-name={CTX_NAME} {...config} />
3939
{/* @ts-ignore */}
4040
<AdapterUploadCtxProvider
41-
ref={refUploadCtxProvider}
41+
ref={apiRef}
4242
ctx-name={CTX_NAME}
4343
{...eventHandlers}
4444
/>

packages/react-uploader/src/Uploader/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export type TEventsSchema = {
1818
};
1919

2020
type TRefUploadCtxProvider = {
21-
refUploadCtxProvider?: Ref<InstanceType<UploadCtxProvider>>;
21+
apiRef?: Ref<InstanceType<UploadCtxProvider>>;
2222
};
2323

2424
type TPropsWithEvents = Partial<TEventsSchema>;

0 commit comments

Comments
 (0)