File tree 5 files changed +10
-10
lines changed
5 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -103,8 +103,8 @@ import {FileUploaderRegular} from "@uploadcare/react-uploader";
103
103
104
104
## File Uploader API
105
105
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 ] .
108
108
It is important to note that we now pass all InstanceType from UploadCtxProvider.
109
109
110
110
``` jsx
@@ -118,7 +118,7 @@ const Example = () => {
118
118
const uploaderRef = useRef < InstanceType < UploadCtxProvider > | null > (null );
119
119
120
120
121
- < FileUploaderRegular refUploadCtxProvider = {uploaderRef} pubkey= " YOUR_PUBLIC_KEY" / > ;
121
+ < FileUploaderRegular apiRef = {uploaderRef} pubkey= " YOUR_PUBLIC_KEY" / > ;
122
122
}
123
123
```
124
124
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ const CSS_SRC_INLINE = getStyleSource("inline");
20
20
export const FileUploaderInline : FC < TProps > = ( {
21
21
ctxName,
22
22
className,
23
- refUploadCtxProvider ,
23
+ apiRef ,
24
24
...props
25
25
} ) => {
26
26
const CTX_NAME = useMemo ( ( ) => ctxName ?? LR . UID . generate ( ) , [ ctxName ] ) ;
@@ -36,7 +36,7 @@ export const FileUploaderInline: FC<TProps> = ({
36
36
< AdapterConfig userAgentIntegration = { getUserAgentIntegration ( ) } ctx-name = { CTX_NAME } { ...config } />
37
37
{ /* @ts -ignore */ }
38
38
< AdapterUploadCtxProvider
39
- ref = { refUploadCtxProvider }
39
+ ref = { apiRef }
40
40
ctx-name = { CTX_NAME }
41
41
{ ...eventHandlers }
42
42
/>
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ const CSS_SRC_MINIMAL = getStyleSource("minimal");
21
21
export const FileUploaderMinimal : FC < TProps > = ( {
22
22
ctxName,
23
23
className,
24
- refUploadCtxProvider ,
24
+ apiRef ,
25
25
...props
26
26
} ) => {
27
27
const CTX_NAME = useMemo ( ( ) => ctxName ?? LR . UID . generate ( ) , [ ctxName ] ) ;
@@ -37,7 +37,7 @@ export const FileUploaderMinimal: FC<TProps> = ({
37
37
< AdapterConfig userAgentIntegration = { getUserAgentIntegration ( ) } ctx-name = { CTX_NAME } { ...config } />
38
38
{ /* @ts -ignore */ }
39
39
< AdapterUploadCtxProvider
40
- ref = { refUploadCtxProvider }
40
+ ref = { apiRef }
41
41
ctx-name = { CTX_NAME }
42
42
{ ...eventHandlers }
43
43
/>
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ const CSS_SRC_REGULAR = getStyleSource("regular");
22
22
export const FileUploaderRegular : FC < TProps > = ( {
23
23
ctxName,
24
24
className,
25
- refUploadCtxProvider ,
25
+ apiRef ,
26
26
...props
27
27
} ) => {
28
28
const CTX_NAME = useMemo ( ( ) => ctxName ?? LR . UID . generate ( ) , [ ctxName ] ) ;
@@ -38,7 +38,7 @@ export const FileUploaderRegular: FC<TProps> = ({
38
38
< AdapterConfig userAgentIntegration = { getUserAgentIntegration ( ) } ctx-name = { CTX_NAME } { ...config } />
39
39
{ /* @ts -ignore */ }
40
40
< AdapterUploadCtxProvider
41
- ref = { refUploadCtxProvider }
41
+ ref = { apiRef }
42
42
ctx-name = { CTX_NAME }
43
43
{ ...eventHandlers }
44
44
/>
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ export type TEventsSchema = {
18
18
} ;
19
19
20
20
type TRefUploadCtxProvider = {
21
- refUploadCtxProvider ?: Ref < InstanceType < UploadCtxProvider > > ;
21
+ apiRef ?: Ref < InstanceType < UploadCtxProvider > > ;
22
22
} ;
23
23
24
24
type TPropsWithEvents = Partial < TEventsSchema > ;
You can’t perform that action at this time.
0 commit comments