diff --git a/README.md b/README.md index da199e9..aa20fbe 100644 --- a/README.md +++ b/README.md @@ -57,10 +57,10 @@ type Placeholder = { }; ``` -show placeholder while loading. +show placeholder while loading, either `thumbhash` or `blurhash` -- [blurhash](https://blurha.sh/) - [thumbhash](https://evanw.github.io/thumbhash/) +- [blurhash](https://blurha.sh/) ### `cachePolicy?: enum` diff --git a/src/TurboImage.tsx b/src/TurboImage.tsx index 69e491d..2ec79b8 100644 --- a/src/TurboImage.tsx +++ b/src/TurboImage.tsx @@ -44,6 +44,10 @@ const TurboImage = (props: TurboImageProps) => { ...restProps } = props; + if (placeholder && Object.keys(placeholder).length > 1) { + throw new Error('Choose one hash string, either thumbhash or blurhash'); + } + const processedIndicator = indicator && Object.keys(indicator).length !== 0 ? {