[native] Add thumbHash prop to image components
Summary:
This diff exposes the expo-image's placeholder prop (docs). For <LoadableImage> and <RemoteImage> it is passed directly for flexibility.
For encrypted images, the thumbHash is encrypted so it must be decrypted before creating a placeholder. For non-encrypted images, it can be passed directly.
The part where multimedia.react.js receives the thumbhash prop will be added in next diffs whenkeyserver support is added.
Depends on D7761
Test Plan:
Here are a few thumbhash examples that you can pass to the prop:
// these are raw, non-encrypted thumbhash strings const thumbhashes = [ '1EgOHYQImHiZZ4iCe3eWeAinolA8', '5xcSHQZpeI94KIenaHhoh2ufo/Y4', 'EQgKHQZlh2122Hb4dm2Gh2hwkQc3', 'GTSBBIAmOIlphnApR+P7ijmPhYUIR4h3Bg', 'JRkaPQh4d394V4doeHd3h3iAgAcI', 'TwgOFQKniXV1+JeYh3u2mLZ1b1v3', 'YGkKHQKnh392CGdXpXVoeptu0IgF', 'E9cJVRB6h493R3iIeHmXZ3hwhAg3', ]; const thumbhash = thumbhashes[Math.random() % thumbhashes.length]; const placeholder = { thumbhash }; `
Reviewers: ginsu, atul, inka
Reviewed By: atul
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D7765