Preserve jsx comment (#7155)

This commit is contained in:
Raja Sekar 2018-01-05 01:41:09 +05:30 committed by Brian Ng
parent 8250ff963e
commit 152e95fb52
4 changed files with 34 additions and 1 deletions

View File

@ -91,7 +91,9 @@ export function JSXClosingElement(node: Object) {
this.token(">");
}
export function JSXEmptyExpression() {}
export function JSXEmptyExpression(node: Object) {
this.printInnerComments(node);
}
export function JSXFragment(node: Object) {
this.print(node.openingFragment, node);

View File

@ -0,0 +1,13 @@
class Demo extends React.Component {
constructor(props) {
super(props);
this.state = {};
}
render() {
return <div>
<Dialog>
{/*<div>I am a jsx comment!!</div>*/}
</Dialog>
</div>;
}
}

View File

@ -0,0 +1,17 @@
class Demo extends React.Component {
constructor(props) {
super(props);
this.state = {};
}
render() {
return <div>
<Dialog>
{
/*<div>I am a jsx comment!!</div>*/
}
</Dialog>
</div>;
}
}

View File

@ -0,0 +1 @@
{ "plugins": ["jsx"] }