Skip to content
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

JSX for everything #16474

Closed
pie6k opened this issue Jun 13, 2017 · 2 comments
Closed

JSX for everything #16474

pie6k opened this issue Jun 13, 2017 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@pie6k
Copy link

pie6k commented Jun 13, 2017

JSX is great for defining parts of DOM tree eg divs etc. But it's also great for other things, like for example defining language grammar: https://github.com/laconalabs/elliptical for parsing library.

However:

  1. how can I have multiple jsx factories in the same project (eg. I'm using react for most of the things, but I've got few files where I want to use jsx for something else)
    • My 'hack' for that is I import 'fake' React with createElement function into file scope that will be used instead like import React from './fakeReact' but it's not that elegant.
    • and, using custom factory this way, when my jsx factory returns some custom value, ts is complaining that my component (which is not actual component in this context) doent have render method:
      image

Right now I have 'feeling' that JSX of Typescript is strongly tied with DOM definitions and React while it's great for many other things too or even for such things like defining complex data structures as 'xml' matching some typescript interface?

@DanielRosenwasser
Copy link
Member

how can I have multiple jsx factories in the same project (eg. I'm using react for most of the things, but I've got few files where I want to use jsx for something else)

For the record, it looks like this is tracked by #15386, and I think some of the same points have been made there.

@DanielRosenwasser DanielRosenwasser added the Duplicate An existing issue was already created label Jun 13, 2017
@mhegazy
Copy link
Contributor

mhegazy commented Aug 17, 2017

Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.

@mhegazy mhegazy closed this as completed Aug 17, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 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

3 participants