Typescript
To add Typescript support (if you started with a Javascript template) do the following:
- Yarn
- NPM
Terminal.app
Terminal.app
Create a file named types.d.ts
to silence errors when importing assets such as import logo from "../assets/logo.png"
.
types.d.ts
Add this minimal tsconfig.json
:
tsconfig.json
Now you can code your templates using Typescript:
templates/main.tsx
note
Remember to use the extension .tsx
for Typescript files.
tip
Visit the repository @flayyer/flayyer-types for more info regarding types.