Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Props type safety #1263

@jurokapsiar

Description

@jurokapsiar

Feature Request

Problem description

Props are not type safe, for example this is a valid code that compiles using Typescript:
<Button title={{test: true}} ariaLabel={{test: true}} />

This has some implications to how we are doing translations (outside of Stardust scope) where there is one function that returns a string and one that returns React.Node intended for rendering the subtree for RTL purposes.

With no type checking on props like title or aria-label, we do not have any realiable way to enforce usage of the correct functions

Proposed solution

Provide typings at least for the common html props similar to the types provided by "@types/react"

MVP

https://codesandbox.io/s/rl9068mvro

Metadata

Metadata

Assignees

No one assigned

    Labels

    vstsPaired with ticket in vsts

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions