microsoft / microsoft/react-native-windows

Add Upstream Support for Lack of Dimensions

Open
#4,050 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area: Dimensions Deforking enhancement Workstream: Component Parity
Dominant language
C++
Stars
17.3k
Forks
1.2k
Avg merge
1d 13h
Merged PRs (30d)
33

Description

The Dimensions and indirectly the PixelRatio API is dangerous to use outside of cases where DPI is consistent throughout a system. react-native-win32 intentionally does not correctly implement its functions. We need to patch React Native to get around this. E.g. changing how we calculate hairlineWidth in StyleSheet.win32.js.

We should add upstream support for having this API optionally present, or even better, come up with a plan to provide a better alternative to Dimensions.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the issue's discussion of the Dimensions and PixelRatio APIs, then inspect StyleSheet.win32.js where hairlineWidth is calculated. Trace how these APIs are consumed on Windows and compare the current upstream React Native behavior. Done requires a documented, agreed approach for optional API support or a better alternative, with the hairlineWidth case addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.