Skip to content

Skeleton height/width prop incorrect typing #3799

@Blargel

Description

@Blargel

Is there an existing issue for this?

  • I have searched the existing issues

Explain what you did

I'm developing with TypeScript and I'm trying to make the Skeleton component fill up a containing View by setting its height and width to 100%.

Expected behavior

I expected that setting the height and width props to the string "100%" would be accepted by TypeScript.

Describe the bug

The height and width props are typed as numbers so TypeScript complains. When running the code anyway, the height and width is still properly set despite this. As a workaround to the typing issues, you can set the height and width using the style prop instead. Interesting, the style prop is not listed in the documentation but the skeletonStyle prop is. However, the skeletonStyle prop does not work for this workaround.

Steps To Reproduce

While using TypeScript, try using the Skeleton component like this:

<Skeleton width="100%" height="100%" />

Screenshots

No response

Your Environment

`npx @rneui/envinfo` Sorry, the command is taking a ridiculously long time for some reason. If this is really needed for some reason, I'll edit it in later.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions