Skip to content

Allow JSX pragmas (enable editing of tsconfig) #12

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
jorgebucaran opened this issue Aug 4, 2017 · 5 comments
Closed

Allow JSX pragmas (enable editing of tsconfig) #12

jorgebucaran opened this issue Aug 4, 2017 · 5 comments

Comments

@jorgebucaran
Copy link

jorgebucaran commented Aug 4, 2017

Hi @EricSimons @apai4!

This project looks amazing. I tried to create a simple starter for Hyperapp, but it keeps telling me that React is not defined.

I tried using the JSX pragma like this: /** @jsx h */, but it made no difference.

See: https://hyperapp.stackblitz.io

@EricSimons
Copy link
Member

@jbucaran thanks for the kind words! And absolutely — ability to edit TSConfig/etc should be landing soon, so that should allow you to do this: microsoft/TypeScript#9582 (comment)

Will circle back once we open up editing of TSConfig! 👍

@EricSimons EricSimons changed the title How to setup JSX with a custom hyperscript function? Allow JSX pragmas (enable editing of tsconfig Aug 6, 2017
@EricSimons EricSimons changed the title Allow JSX pragmas (enable editing of tsconfig Allow JSX pragmas (enable editing of tsconfig) Aug 6, 2017
@Hakuz
Copy link

Hakuz commented Nov 10, 2018

Looks like this adding /** @jsx h */ before import is working now. So if you're getting the react is not defined please do this.

/** @jsx h */ 
import { h, app } from 'hyperapp'

@loreanvictor
Copy link

So currently I can add a tsconfig.json to the root folder and configure the custom JSX factory that way. With this setup, the code is properly transpiled and loaded in the preview window, however the IDE apparently does not pick up the changes and still looks for React. Adding /** @jsx ... */ on top of each file resolves that particular inconvenience as well.

Any status update on this issue?

@purplem1lk
Copy link
Contributor

Thank you for your patience - We are launching new core technology into beta next month that should resolve this issue so this will be closed accordingly. If this issue persists, feel free to tag me or ask to reopen this issue with screenshots of the error. Thank you! :)

@OlaoluwaM
Copy link

@purplem1lk seems like the issue persists even after adding a custom tsconfig.json

image

tsconfig.json

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants