Closed Dontag closed 4 years ago
Actually this can be done via prop renderIndicator
.
Actually this can be done via prop
renderIndicator
.
but how to do it??
@Dontag
renderIndicator={() => {}}
@Dontag
renderIndicator={() => {}}
Yes Got it,
@Dontag It would raise a typescript error simply by adding renderIndicator={() => {}}
:
自定义计时器
No overload matches this call.
Overload 1 of 2, '(props: Props | Readonly<Props>): ImageViewer', gave the following error.
Type '() => void' is not assignable to type '(currentIndex?: number | undefined, allSize?: number | undefined) => ReactElement<any, string | JSXElementConstructor<any>>'.
Type 'void' is not assignable to type 'ReactElement<any, string | JSXElementConstructor<any>>'.
Overload 2 of 2, '(props: Props, context: any): ImageViewer', gave the following error.
Type '() => void' is not assignable to type '(currentIndex?: number | undefined, allSize?: number | undefined) => ReactElement<any, string | JSXElementConstructor<any>>'.ts(2769)
image-viewer.type.d.ts(113, 5): The expected type comes from property 'renderIndicator' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<ImageViewer> & Pick<Readonly<Props> & Readonly<{ ...; }>, "children"> & Partial<...> & Partial<...>'
image-viewer.type.d.ts(113, 5): The expected type comes from property 'renderIndicator' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<ImageViewer> & Pick<Readonly<Props> & Readonly<{ ...; }>, "children"> & Partial<...> & Partial<...>'
Can you set an option to accept false
as the value to disable the indicator?
@Dontag It would raise a typescript error simply by adding
renderIndicator={() => {}}
:自定义计时器 No overload matches this call. Overload 1 of 2, '(props: Props | Readonly<Props>): ImageViewer', gave the following error. Type '() => void' is not assignable to type '(currentIndex?: number | undefined, allSize?: number | undefined) => ReactElement<any, string | JSXElementConstructor<any>>'. Type 'void' is not assignable to type 'ReactElement<any, string | JSXElementConstructor<any>>'. Overload 2 of 2, '(props: Props, context: any): ImageViewer', gave the following error. Type '() => void' is not assignable to type '(currentIndex?: number | undefined, allSize?: number | undefined) => ReactElement<any, string | JSXElementConstructor<any>>'.ts(2769) image-viewer.type.d.ts(113, 5): The expected type comes from property 'renderIndicator' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<ImageViewer> & Pick<Readonly<Props> & Readonly<{ ...; }>, "children"> & Partial<...> & Partial<...>' image-viewer.type.d.ts(113, 5): The expected type comes from property 'renderIndicator' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<ImageViewer> & Pick<Readonly<Props> & Readonly<{ ...; }>, "children"> & Partial<...> & Partial<...>'
Can you set an option to accept
false
as the value to disable the indicator?
try this
renderIndicator={() => null}
nderIndicator={() => null}
not working...
returning an empty jsx would do the trick instead (tested only on ios): renderIndicator={() => (<></>)}
returning an empty jsx would do the trick instead (tested only on ios):
renderIndicator={() => (<></>)}
Yes working on iOS 👍
there is no option to disable the Index Indicator. It is important if need to show only one image