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

What about converting JSX to JSONX ? #386

Open
asgeo1 opened this issue Sep 23, 2021 · 1 comment
Open

What about converting JSX to JSONX ? #386

asgeo1 opened this issue Sep 23, 2021 · 1 comment

Comments

@asgeo1
Copy link

asgeo1 commented Sep 23, 2021

It's really neat that this library allows React components to be rendered from JSON.

But what about going the other way? i.e. starting with JSX and converting that to JSONX syntax?

I have this idea where a user writes some JSX code (perhaps in web-based GUI), and then I'd like to serialize it to JSONX, so it can be stored in a database. Then I'd be able to send it via an API to some other app, where it can be translated back to JSX and rendered.

is that possible with this or any other library?

@yawetse
Copy link
Member

yawetse commented Jan 10, 2022

I think it is possible, it would probably involve taking a look at babel/typescript JSX parsers that convert JSX to React.CreateElement etc - updating the transpiler to JSONX

I might tinker around with this later

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

2 participants