)\r\nconst el = // throws an error\r\nconst el2 = // throws an error\r\n```\r\n\r\nThis is because due to limitations in the compiler, function components cannot return anything other than a JSX expression or `null`, otherwise it complains with a cryptic error message saying that the other type is not assignable to `Element`. Unfortunately just annotating the function type will not help so if you *really* need to return other exotic types that React supports, you'd need to perform a type assertion:\r\n```tsx\r\nconst MyArrayComponent = () => Array(5).fill() as any as JSX.Element\r\n```\r\n\r\nFor the section on *Class Components*:\r\n- I recommend annotating the `state` class property in addition to adding it as the 2nd generic type parameter in the base class, because it allows better type inference when accessing `this.state` and also initializing the state. This is because they work in two different ways, the 2nd generic type parameter will allow `this.setState()` to work correctly, because that method comes from the base class, but initializing `state` inside the component overrides the base implementation so you have to make sure that you tell the compiler that you're not actually doing anything different.\r\n```ts\r\ntype MyState = {}\r\nclass App extends React.Component<{}, MyState> { state: MyState = {} }\r\n```\r\n\r\nFor the section on *Typing DefaultProps*:\r\n- I strongly do *not* recommend annotating `defaultProps` into a `Partial` of your `Props` interface. This causes issues that are a bit complex to explain here with the type inference working with `JSX.LibraryManagedAttributes`. Basically it causes the compiler to think that when creating a JSX expression with that component, that all of its props are optional. Don't do this! Instead this pattern is recommended:\r\n\r\n```ts\r\ntype Props = Required & { /* additional props here */ }\r\n\r\nexport class MyComponent extends React.Component {\r\n static defaultProps = {\r\n foo: 'foo'\r\n }\r\n}\r\n```\r\n\r\nFor the section on *Forms and Events*:\r\n- I would just add that inlining the event handler when you don't need to optimize is recommended for better type inference:\r\n```tsx\r\n// instead of this:\r\nconst myHandler = (event: React.MouseEvent) => {}\r\nconst el = \r\n\r\n// do this:\r\nconst el =