User
type that we use to type the state value using the useState<User>
syntax.{ id: 1, name: 'Fabio' }
and we update it when the button is clicked invoking the updateName
function:<Type>
it means that we are using a more advanced TypeScript concept known as Generics Parameters.name
:number
instead of a string
in the name
property):