You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rebecca Alpert edited this page May 1, 2019
·
10 revisions
What is TypeScript?
TypeScript extends plain-old JavaScript with static typing. It can make code easier to understand and maintain by specifying properties and behavior more explicitly.
Interfaces, classes, and enums allow you to define custom types that describe data structures and behavior. You can also share properties and behavior between different types via inheritance.
The type you use in React.HTMLProps<YOUR TYPE HERE> should reflect the type of the component you return. In cases where the component can return multiple components with different types, you should use a more generic type like HTMLElement.
To see available types, go to node_modules/typescript/lib/lib.dom.d.ts in the root PatternFly-React folder after running yarn install.