Step 10 - React tutorial: Model Class State with TypeScript interfaces

Publicado el: 03 junio 2020
en el canal de: PyCharm, a JetBrains IDE
1,544
7

Step 10 in the "React, TypeScript, and TDD" tutorial

Make a very simple class component with local counter state, then make an interface for that state.

00:00 - Start
00:23 - Start with a failing test
00:39 - Add an interface to model the state
00:53 - Add this as the second interface in the generic (props and state)
00:57 - Component constructor, including state initializing
01:38 - Change the TSX to display that state (the count)
01:48 - The tests now pass
01:57 - Allow passing in a prop for counter starting value, starting with a test
02:02 - "Fail faster" thanks to TypeScript
02:20 - Optional starting value in interface
02:23 - Provide default prop value
02:30 - The state gets its starting value from this optional prop
03:12 - Type guard for complaint about possible missing value


More on this tutorial step:
https://www.jetbrains.com/pycharm/gui...
The rest of this "React, TypeScript, and TDD" tutorial:
https://www.jetbrains.com/pycharm/gui...
See tips, tutorials, and more in the PyCharm Guide:
https://www.jetbrains.com/pycharm/gui...


En esta página del sitio puede ver el video en línea Step 10 - React tutorial: Model Class State with TypeScript interfaces de Duración hora minuto segunda en buena calidad , que subió el usuario PyCharm, a JetBrains IDE 03 junio 2020, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 1,544 veces y le gustó 7 a los espectadores. Disfruta viendo!