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
It appears that sweetjs cannot compile react classes whose functions are written without semi-colons.
E.g. the following code
var React = require('react')
var CommentBox = React.createClass({
hey: function(){
var how = 0 //no semicolon here
if (are){
console.log('you');
}
},
render: function() {
return (
<div className="commentBox">
Hello, world! I am a CommentBox.
</div>
);
}
});
will throw the following error :
Error: Line 4: Unexpected token if
[... how = 0 if ( are ...]
at throwError (/home/mael/.node/lib/node_modules/sweet.js/lib/parser.js:1887:21)
at throwUnexpected (/home/mael/.node/lib/node_modules/sweet.js/lib/parser.js:1933:13)
at consumeSemicolon (/home/mael/.node/lib/node_modules/sweet.js/lib/parser.js:1994:13)
Is this unavoidable ?
The text was updated successfully, but these errors were encountered:
Hi,
It appears that sweetjs cannot compile react classes whose functions are written without semi-colons.
E.g. the following code
will throw the following error :
Is this unavoidable ?
The text was updated successfully, but these errors were encountered: