jsx-render
jsx-render copied to clipboard
Suggestion: Add createElement export for dom
webpack has the option for aliasing one module name with another, so you could alias react as jsx-render and use the default React.createElement function from the jsx loader
This would allow using the same components on the server and client side provided they're compatible enough
Hey @DanTheMan827 is not a bad idea but will add a little bit of coupling one to webpack and other few but I'm open to evaluating it from a PR to the #8 that includes a work in progress for the server side rendering feature
just for reference, I made a simple include file in my project with the following content that when added as an alias with webpack provides enough of the React functionality to not cause errors for basic stuff, I haven't tried any complex stuff though.
export { default as createElement, Fragment } from 'jsx-render'
by aliasing react to that include file, things like import * as React from 'react' work without any issues