Skip to content

ES6+ with React Native preview - not possible with either Salsa or TypeScript #7343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
egamma opened this issue Mar 2, 2016 · 4 comments
Closed
Assignees
Labels
Duplicate An existing issue was already created

Comments

@egamma
Copy link
Member

egamma commented Mar 2, 2016

From @kristianmandrup on March 2, 2016 11:59

Trying to create a React component as a class. Currently my file is called GiftedMessengerExample.js and detected as Javascript (Salsa)

Following guidelines here: https://babeljs.io/blog/2015/06/07/react-on-es6-plus

Converting method into a property declaration with arrow function. However, when I do this, the IDE complains that this is only supported with TypeScript .ts files.
However, if I change the extension to .ts it complains about my JSX and type declarations for React imports such as Text and StyleSheet etc.

Please fix this :)

class GiftedMessengerExample extends Component {

  handleSend = (message = {}, rowID = null) => {
    this._gm.setMessageStatus('ErrorButton', rowID); 
  }

Copied from original issue: microsoft/vscode#3628

@egamma egamma self-assigned this Mar 2, 2016
@egamma
Copy link
Member Author

egamma commented Mar 2, 2016

From @davezuko on March 2, 2016 13:46

Could this be related to #6997 at all?

(As an aside, I'm not a TS user, but should it be .tsx if you're using JSX? )

@egamma
Copy link
Member Author

egamma commented Mar 2, 2016

From @kristianmandrup on March 2, 2016 14:22

Wasn't aware of .tsx but I tried it and didn't work either. Looks like a fix (or docs) is in the works from what I can gather from the other issues related to this...
Thanks!

@egamma
Copy link
Member Author

egamma commented Mar 2, 2016

Same behaviour when using the latest Code Insider build with TS 1.8.2.

Moving to TypeScript.

@mhegazy
Copy link
Contributor

mhegazy commented Mar 2, 2016

looks like a duplicate of #6997.

@mhegazy mhegazy closed this as completed Mar 2, 2016
@mhegazy mhegazy added the Duplicate An existing issue was already created label Mar 2, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants