You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- extend ImageLoader.load params
- Removed the old `image.decode` change as it's covered by the minimal browser versions supported here
- add examples for Images with headers
- Image - remove requestRef - no longer needed
- rename `ImageLoader.abort` to `.release`
The method is mostly used as cleanup
(e.g. useEffect cleanup, or releasing resources when component unmounts)
- Image - extract `useSource` hook
Move the image loading effect here
Changed the original logic slightly for less nesting
Changed to cover cases where passing the same headers object was starting new loads, as it was treated as a different value due to referential equality
- Image - add tests covering added/changed functionality around source
- Image - handle cases where the source object only changes by reference
When the source object changed by reference, but stays structurally the same, we should do nothing and not trigger the loading effect again
- Image - extract ImageLoadingProps
Update types to match RN and actual code - we don't call `onLoadStart` and `onLoadEnd` with any arguments
- ImageLoader extract types.js
- Image - resolve `onLoad` with `source`
Use the same `nativeEvent` structure as in RN for the onLoad event
- Rework Image loading and source management logic
Since introducing the change to support headers changes to the original
changes are needed:
- support loading a default source with headers
- handle source object changes
- update uri resolving logic to handle blob URLs create by `URL.createObjectURL`
- move the URI/source resolving logic to the `ImageLoader`
BREAKING CHANGE
`onLoad` was previously called with `nativeEvent` that was the browser Event object
from the image.onload handler
Since we can't spread or mutate the Event object to add `source` we have to
either add it under a new key or remove it
The browser Event does not expose very useful information, (no target, or size info),
so it seems best to replace `nativeEvent` with the same structure used in `react-native`
0 commit comments