Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: reuse 'img' renderer internal logic w/t
useIMGElementState
hook
This is a complete refactoring as much as a feature of the image renderer. Thanks to this new hook, you can very easily create custom image renderers which still preserves the rich scaling behavior of the internal component. This hook will return three different states: - 'loading', when the natural image dimensions have not been retrieved yet; - 'success', when the concrete image dimensions are available; - 'error', when the image could not be cached. During the 'loading' phase, this hooks uses `Image.getSize` from react native to pre-fetch the image and access its natural (intrinsic) dimensions. See https://drafts.csswg.org/css-images/#sizing-terms for detailed definitions relating to "concrete", "specified" and "natural" dimensions. fix #424
- Loading branch information