Skip to content

Stylesheet.create does not support strict TypeScript type checking or intellisense #392

@rpggio

Description

@rpggio

CSSProperties type does not support strict typing. It allows any property name to be used for a style. This prevents type checking and intellisense for Stylesheet.create.
It appears this is due to CSSPropertiesLossy in the type.

Example:
https://codesandbox.io/s/aphrodite-no-type-checking-itwip?file=/src/index.ts

const styles1 = StyleSheet.create({
  blue: {
    backgroundColor: "lightblue",
    // no strict typing
    murgin: "5px"
  }
});

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