jsx-render icon indicating copy to clipboard operation
jsx-render copied to clipboard

Suggestion: Add createElement export for dom

Open DanTheMan827 opened this issue 6 years ago • 2 comments

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

DanTheMan827 avatar Feb 06 '19 23:02 DanTheMan827

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

alexrqs avatar Feb 13 '19 00:02 alexrqs

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

DanTheMan827 avatar Feb 21 '19 15:02 DanTheMan827