airbnb / airbnb/react-sketchapp

Better Image API Parity with React Native

Open
#526 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
14.9k
Forks
797
PR merge metrics
No merged PRs in 30d

Description

_I am..._

| -------------------------------------------------------------------------------------------------
| Requesting a new feature
| -------------------------------------------------------------------------------------------------

**Proposal/Feature-request:**

Improve the Image API parity with React Native by adding some of the static methods and extra props like `blurRadius`.

The main API method that would be useful is `Image.getSize()` to make getting image aspect ratios easier, for better use with the `useWindowDimensions` API. It's possible methods like `onLayout` could be implemented with the efforts in #472 too.

Implementation details:

- https://github.com/sketch-hq/sketch-reference-files/blob/master/files/123/images/pages/BE059DA8-F958-4C4A-A294-4FFB0713F90C.json#L100-L101
- https://developer.sketch.com/reference/api/#imagedata – (but probably not much use as won't work in Node.js/cross-platform mode)

Contributor guide

Open the contributing guide

Research direction

Start with the existing Image API and review the React Native reference linked in the issue, along with the work in #472. Establish which static methods and props are in scope, prioritizing Image.getSize(), then verify the resulting API supports image aspect-ratio use with useWindowDimensions.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, react-native, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.