microsoft / microsoft/react-native-windows
Add Upstream Support for Lack of Dimensions
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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