diff --git a/CHANGELOG.md b/CHANGELOG.md index beece54..3ab1eed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [1.0.3] (2024-08-18) + +#### Bug Fixes + +- Fixed a bug that caused an infinite loading loop when an image failed to load. + ## [1.0.2] (2024-08-16) #### Bug Fixes @@ -166,6 +172,8 @@ - Initial release. +[1.0.3]: https://github.com/xerdnu/react-native-blasted-image/compare/v1.0.2...v1.0.3 +[1.0.2]: https://github.com/xerdnu/react-native-blasted-image/compare/v1.0.1...v1.0.2 [1.0.1]: https://github.com/xerdnu/react-native-blasted-image/compare/v1.0.0...v1.0.1 [1.0.0]: https://github.com/xerdnu/react-native-blasted-image/compare/v0.0.13...v1.0.0 [0.0.13]: https://github.com/xerdnu/react-native-blasted-image/compare/v0.0.12...v0.0.13 diff --git a/index.js b/index.js index 4678fb9..4945cd6 100644 --- a/index.js +++ b/index.js @@ -71,7 +71,7 @@ const BlastedImage = ({ } useEffect(() => { - if (typeof source === 'number') { + if (typeof source === 'number' || error) { return; } @@ -88,7 +88,7 @@ const BlastedImage = ({ }; fetchImage(); - }, [source]); + }, [source, error]); // Flatten styles if provided as an array, otherwise use style as-is const flattenedStyle = Array.isArray(style) ? Object.assign({}, ...style) : style; diff --git a/package.json b/package.json index ed2039f..8a524eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-blasted-image", - "version": "1.0.2", + "version": "1.0.3", "description": "A simple yet powerful image component for React Native, powered by Glide and SDWebImage", "main": "index.js", "types": "index.d.ts",