I've installed some third party library for React: react-draft-wysiwyg
While exploring the source code, i was surprised to see that my Visual Studio Code IDE gives me alot of syntax errors, within the JS files. For example, this function:
onEditorBlur: Function = (): void => {
this.setState({
editorFocused: false
});
};
My editor tells me that "types can only be used in a TS file".
The package.json "main" filed points to an already bundled file, but when i try to switch it to the src folder, i get various errors, like "you need a special loader..."
Is there some way to use typescript within JS?