You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot parse HTML to JSX without using outputClassName #21
Great job on react-magic. I'm trying to use this component with the following option:
{
createClass: true
}
I would expect the following output:
"React.createClass..."
but it turns out to be
"var NewComponent = React.createClass...."
I see in the code that the config outputClassName is optional. In the convert function we have:
if(this.config.createClass){if(this.config.outputClassName){this.output='var '+this.config.outputClassName+' = React.createClass({\n';}else{// this is the callback i was expecting to be calledthis.output='React.createClass({\n';}this.output+=this.config.indent+'render: function() {'+"\n";this.output+=this.config.indent+this.config.indent+'return (\n';}
But in the object constructor there is always a fallback to 'NewComponent', from the source-code:
varHTMLtoJSX=function(config){this.config=config||{};if(this.config.createClass===undefined){this.config.createClass=true;}if(!this.config.indent){this.config.indent=' ';}if(!this.config.outputClassName){// I would not expect to have this line in place.this.config.outputClassName='NewComponent';}};
changed the title [-]Cannot parser HTML to JSX without using outputClassName[/-][+]Cannot parse HTML to JSX without using outputClassName[/+]on Mar 23, 2015
Activity
[-]Cannot parser HTML to JSX without using outputClassName[/-][+]Cannot parse HTML to JSX without using outputClassName[/+]Daniel15 commentedon Apr 20, 2015
Fixed by #22