Skip to content
Advertisement

Update Javascript code to Typescript to fix implicitly error

I’m working on my first react (Typescript) project and there is an issue with my code below.

I’m getting this error – Parameter 'name' implicitly has an 'any' type.ts(7006)

Bellow is my full code

JavaScript

How can I fix this so that works without me needing to set "noImplicitAny": false

Advertisement

Answer

You should give both name and event an explicit type:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement