- This topic has 4 replies, 3 voices, and was last updated 5 years, 4 months ago by mrsgray.
-
AuthorPosts
-
mrsgrayParticipantI’m evaluating MyEclipse for a project of ours (As an eclipse user I’m sick of having to use IntelliJ).
This react project uses typescript version 3.4.5 and react version 16.8.6.
This project compiles and runs well using maven and/or intellij, but in MyEclipse I get the TypeScript Problem:“Property ‘Component’ does not exist on type ‘typeof React'”
import * as React from 'react'; import MaterialList from "./MaterialList"; export interface IAppProps { } export interface IAppState { } class App extends React.Component<IAppProps,IAppState> { constructor(props) { super(props); } render() { return ( <div> Well helloooooow <MaterialList/> </div> ); } } export default App;
According to https://stackoverflow.com/questions/55846462/tslint-error-property-component-does-not-exist-on-type-typeof-react
(which is the only place I found explaining this issue) this has to do with using an old version of typescript.
The application itself uses 3.4.5 and doesn’t have any problem with that statement, but in the project properties under “TypeScript” I see version 2.5.3 is used. Is there a way to make MyEclipse use a more recent typescript version for the tslint validation?
mrsgrayParticipantTo be clear: the MyEclipse tslint validation complains about the “extends React.Component ” on line 7.
Salvador CabreraMemberHi mrsgray,
You can point CodeMix to use the same version of TypeScript that your project is using by:
- Opening the command palette (Ctrl+Shift+P / Cmd+Shift+P)
- Then type and select TypeScript: Select TypeScript Version…
- Finally choose Use Worskspace Version (It should list the TypeScript version your project is using).
Please let me know how it goes.
Cheers,
Sal
Brian FernandesModeratorSorry we jumped the gun with our previous response. For the level of TypeScript support you need, we would recommend installing CodeMix in MyEclipse. CodeMix is free with your MyEclipse subscription, and if you have a few minutes, you can get a quick overview of its features in this video: https://youtu.be/Y0mmP-bji-k
To install CodeMix, visit this page: https://marketplace.eclipse.org/content/codemix-3 and drag and drop the Install button into your MyEclipse install. After finishing the installation and restarting, you can follow Sal’s instructions above.
mrsgrayParticipantThank you. This is indeed much better.
-
AuthorPosts