Open JacoSmit opened 6 years ago
Hi,
I am trying to import a .ts file from a .tsx file but I get the following error:
.ts
.tsx
TS2306: File 'C:/development/article.ts' is not a module.
article.ts
export default class Article { constructor( private _title: string, private _description: string, private _author: string, private _content: string[], private _id: string ) { } get title(): string { return this._title; } get description(): string { return this._description; } get author(): string { return this._author; } get content(): string[] { return this._content; } get id(): string { return this._id; } }
Importing in the .tsx file as:
... import * as Article from './article'; ...
Do I need to declare a typings file or should this be enough?
Hi,
I am trying to import a
.ts
file from a.tsx
file but I get the following error:article.ts
Importing in the
.tsx
file as:Do I need to declare a typings file or should this be enough?