Skip to content

rewrite useWindowDimensions #2798

@LyndonPang

Description

@LyndonPang

Is there an existing request?

  • I have searched for this request

Describe the feature request

I have an idea. I'm not sure if it's correct. I hope everyone can judge it.

I hope to downgrade the useWindowDimensions hooks to a regular function. Using a listener to modify height, width, and scale is a poor practice. By adopting the rem scheme, height and width can be set as unchanging strings (e.g., height: '1rem'), which not only meets adaptability needs but also enhances performance. Specifically, set the font-size of the html node to 40px, so 1rem equals 40px. When the screen size decreases, adjust the html node's font-size to 20px, making 1rem equal to 20px.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementRequires extension or creation of new React Native API

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions