elemental-design / react-platform

Experimental cross-platform React Native interoperability APIs, component wrappers and polyfills.
MIT License
17 stars 0 forks source link

Dimensions and PixelRatio API #3

Open macintoshhelper opened 4 years ago

macintoshhelper commented 4 years ago

Do we want to support React Native's Dimensions and PixelRatio? Or discourage their use?

I propose supporting them, and adding injection systems for react-sketchapp to use global screen dimensions and pixel ratio values, but to later have an opt-out console warning layer to discourage their use and push for using useWindowDimensions instead, as dimensions should not be used as static values.

The main use-case for this would be aliasing react-sketchapp/react-figma to @react-platform/native and keeping things somewhat working. While aliasing will be discouraged by this project, it's a nice way to get a quick proof-of-concept running before refactoring a codebase to import common primitives.