diff --git a/README.md b/README.md index d8d8b64..f4def72 100644 --- a/README.md +++ b/README.md @@ -228,6 +228,7 @@ await CacheManager.isImageCached(uri); | `onLoadEnd` | `Func` | Invoked when load either succeeds or fails | | `resizeMode` | `String` | React native Image component [resizeMode](https://reactnative.dev/docs/image#resizemode) defaults to `contain` | | `testID` | `String` | testID, useful for tests | +| `tintColor` | `String` | tintColor of the source image | | `style` | `Object` | `source` AND `thumbnailSource` image style | | `options` | `Object` | custom options for the fetch image http request eg. `{headers:{}, body:{}}` | | `accessibilityHint` | `string` | accessibility hint for `source` (optional) | diff --git a/src/CachedImage.tsx b/src/CachedImage.tsx index 3e23f1d..c25e2da 100644 --- a/src/CachedImage.tsx +++ b/src/CachedImage.tsx @@ -45,7 +45,7 @@ function useStateIfMounted( const [state, setState] = React.useState(initialState); const newSetState = useCallback( - value => { + (value: any) => { if (isComponentMounted.current) { setState(value); } @@ -231,6 +231,8 @@ const CachedImage = (props: IProps & typeof defaultProps) => { onLoad={onImageLoad} onLoadEnd={props.onLoadEnd} resizeMode={resizeMode || 'contain'} + // @ts-ignore, reanimated image doesn't have tintColor typing + tintColor={props.tintColor} // @ts-ignore source={imageSource} // @ts-ignore diff --git a/src/types.d.ts b/src/types.d.ts index 0c3e954..53aaea1 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -63,6 +63,7 @@ export interface IProps { testID?: string; thumbnailAnimationDuration?: number; thumbnailSource?: string; + tintColor?: string; } export interface Config {