Typescript prompts implicitly has an 'any' type, how to solve this?

as mentioned in the title, during the compilation of typescript, the parameter of the function is prompted {variable name} implicitly has an "any" type, but I don"t know what type of parameter should be specified. I know that this verification rule can be turned off. Is there any other solution? PS, this is react,. I use the arrow function.


add "noImplicitAny" to tsconfig.json: false,


there are three cases of "I don't know":

  • I don't know exactly what it is, but it must have a so-and-so attribute: declare the type literally, {x: string}
  • I'm not sure what attributes it has, and then I'll use if to make a careful judgment: declare it as unknown type
  • .
  • I know it myself, so forget it: declare it as any type
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e49ae3-44d54.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e49ae3-44d54.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?