-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
jsox
support
#176
Labels
Comments
Thank you for posting issue. But I still don't understand. import { * as jsonx } from 'jsonx';
const example_JXM_JSON = {
component:'p',
props:{ style:{ color:'blue' } },
children:'hello world'
};
//Rendering React Components
jsonx.getReactElement(example_JXM_JSON); // => JSX Equivalent: <p style={{color:'blue'}}>hello world</p>
//Generating HTML strings
jsonx.outputHTML({ jsonx: example_JXM_JSON, }); // => '<p style="color:blue;">hello world</p>'
//Generating JSX strings
jsonx.outputJSX({ jsonx: example_JXM_JSON, }); // => '<p style={{color:blue,}}>hello world</p>'
//Rendering HTML Dom with React
jsonx.jsonxRender({ jsonx: example_JXM_JSON, querySelector:'#myApp', });
// <!DOCTYPE html>
// <body>
// <div id="myApp">
// <p style="color:blue;">hello world</p>
// </div>
// </body>
//you can also use the simplified syntax
const simpleJXM_JSON = {
p:{
props:{ style:{ color:'blue' } },
children:'hello world'
}
}
//or if you have an element with no props, simply use {type:children}
const superSimpleJXM = {
ul:[
{li:'first!'},
{li:'second!'},
]
} |
Ah, I'm so sorry, actually I mean JSOX. |
I get it 😄 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/repetere/jsonx#readmehttps://github.com/d3x0r/jsox
This maybe cover #4 at the same time.
The text was updated successfully, but these errors were encountered: