If you write the component as React.FC
, and use useState()
, you can write it like this:
const [arr, setArr] = useState<any[]>([])
More Related Contents:
- Element implicitly has an ‘any’ type because expression of type ‘string’ can’t be used to index
- TypeScript function overloading
- get and set in TypeScript
- How can I see the full expanded contract of a Typescript type?
- How do you emulate nominal typing in TypeScript?
- Typescript: check if a type is a union
- How do you produce a .d.ts “typings” definition file from an existing JavaScript library?
- Typescript, merge object types?
- TypeScript – extract interface members only – possible?
- How to display json object using *ngFor
- Combining generics with index type
- How to overwrite incorrect TypeScript type definition installed via @types/package
- TypeScript TS7015 error when accessing an enum using a string type parameter
- DeepReadonly Object Typescript
- How do I import other TypeScript files?
- VueJS/Typescript – Cannot find module ‘./components/Navigation’ or its corresponding type declarations
- ‘this’ implicitly has type ‘any’ because it does not have a type annotation
- How can I augment a property within a third-party TypeScript interface defined as “any”?
- What does the “as” keyword do?
- Typescript ReturnType of generic function
- Typescript check for the ‘any’ type
- Typescript: Retrieve element type information from array type
- Visual Studio Code Automatic Imports
- Hide .js.map files in Visual Studio Code: File Nesting
- TypeScript empty object for a typed variable
- How to make Typescript infer the keys of an object but define type of its value?
- What does a TypeScript index signature actually mean?
- Why does a Typescript type conditional on `T extends undefined`, with T instantiated with `boolean`, resolve T to `never`?
- TypeScript: deep partial?
- Is it possible to export * as foo in typescript