Skip to content

Update height and width documentation to reflect percentage support #2071

Description

@dscheffy

I can't find reference to support for height and width as a percentage value -- the height and width documentation incorrectly says right at the beginning -- "All dimensions in React Native are unitless, and represent density-independent pixels."

As somebody new to react-native, that's a pretty big oversight in the documentation. After reading that I was surprised to see that support was added for percentage values over two years ago. There was a comment on the issue in the react-native repository kind of hinting at the question "why hasn't this been added to the documentation yet":

Has this been changed recently? I have working code, that uses '100%' in width and height. I also came across Yellobox.js in the RN repo that uses percentages (https://github.com/facebook/react-native/blob/9f33fe258312987f490cc0f3a71c0c4f93494e7f/Libraries/ReactNative/YellowBox.js). However, I can't find any mention of this in the documentation

Is this unintended or is the documentation lacking?

Originally posted by @andrioid in react/react-native#364 (comment)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions