Convert React Class Component to Functional TypeScript Component

preview_player
Показать описание
How to convert a React class based component written in TypeScript to a functional component, also written in TypeScript.
ReactJS Tutorial. React with TypeScript. Please subscribe.
Рекомендации по теме
Комментарии
Автор

***NOTE: @5:12, I'm using a generic with a number array here to avoid the "never[]" error if the array were to be left empty, because in a "real-world" app, most likely you will not have a hard-coded numbers array, but instead will fetch data from somewhere. Additionally, @11:57, the reason that there is a lot of white space between the button and the numbers is because I put the conditionally rendered array below the closing section tag.

Huy_Nguyen_USA