benjycui / jsonml-to-react-element Goto Github PK
View Code? Open in Web Editor NEWTo convert JsonML to React element.
License: MIT License
To convert JsonML to React element.
License: MIT License
Nice library.
I have ton of JsonML stateless components. Each component basically takes parameters and returns JsonML Array.
I was thinking about the best way to wrap / convert JsonML components into React components.
I would appreciate any ides how it can be done.
I'm running Webpack with Babel in my project, but not using the ES2015 preset. Webpack gives me this error:
ERROR in ./node_modules/jsonml-to-react-element/lib/index.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Couldn't find preset "es2015" relative to directory "/Users/reidar/projects/djupvik.digital/node_modules/jsonml-to-react-element"
I believe this error message is because of the Babel configuration in the bundled package.json
:
"babel": {
"presets": [
"es2015"
]
},
I am getting Unhandled rejection Invariant Violation: img is a void element tag and must neither have children
nor use dangerouslySetInnerHTML
. as error.
I think this is happening because the img tag is getting converted to <img src="" alt>
instead of getting converted to <img src="" alt />
. The absence of closing tag is making React throw this error is my guess.
Or is it possible that I am doing something wrong here?
Can you confirm whether img tag gets converted to <img>
or <img />
?
Thanks!
I am getting the following error
Unhandled rejection Invariant Violation: br is a void element tag and must neither have "children" nor use "dangerouslySetInnerHTML".
My JsonML is the following:
[
"H4",
{
"style": "line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"
},
[
"BR"
]
]
Please help
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.