-
Notifications
You must be signed in to change notification settings - Fork 355
TypeScript FAQ
TypeScript extends JavaScript with static typing. It can make code easier to understand and maintain by specifying properties and behavior more explicitly. It also improves the developer experience for consumers of our library through providing typings for other TypeScript projects.
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.
Need to learn TypeScript? Dive into the documentation or the useful links below.
- TypeScript Essential Training on LinkedIn Learning
- Starter Template for TypeScript and React
- React TypeScript Cheatsheet
- React Type Definitions
There are common issues with the docs.
Include typescript: true
in the frontmatter of the markdown.
React-docgen cannot parse types outside of your component file. Move all types to that file. To debug prop errors, you can use this simple script:
const docgen = require('react-docgen');
const props = docgen.parse(`YOUR_COPY_PASTED_COMPONENT_FILE`, null, null, { filename: 'a.tsx' });
console.log(JSON.stringify(props, null, 2));