You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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:
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?
The text was updated successfully, but these errors were encountered:
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.
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
JSX is great for defining parts of DOM tree eg
div
s etc. But it's also great for other things, like for example defining language grammar: https://github.com/laconalabs/elliptical for parsing library.However:
React
withcreateElement
function into file scope that will be used instead likeimport React from './fakeReact'
but it's not that elegant.ts
is complaining that mycomponent
(which is not actual component in this context) doent haverender
method: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?
The text was updated successfully, but these errors were encountered: