Skip to content

useResolveClassNames returns empty styles with the text-base className on the WEB #411

@fiuzagr

Description

@fiuzagr

What happened?

When resolving styles with useResolveClassNames or using the HOC withUniwind on the WEB, the text-base class returns nothing. Consequently, using it to style properties based on font size or line height does not work on the WEB.

The following code does not work to get the line-height and pass it to the size property on the WEB:

const MaterialIcons = withUniwind($MaterialIcons, {
  size: {
    fromClassName: "className",
    styleProperty: "lineHeight",
  },
});

The following code returns an empty object on the WEB:

const stylesWithTextBase = useResolveClassNames("text-base");

This is expected to return the font-size and line-height of text-base, just like on iOS and Android.

Steps to Reproduce

  1. Clone the repository link
  2. Install packages
  3. Run expo npm start
  4. Open WEB browser (press w or localhost:8081)

Snack or Repository Link

https://github.com/fiuzagr/uniwind-extract-styles-bug

Uniwind version

1.3.2

React Native Version

0.81.5

Platforms

Web

Expo

Yes

Additional information

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