Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compile React #147

Open
chrise86 opened this issue Mar 16, 2016 · 1 comment
Open

Cannot compile React #147

chrise86 opened this issue Mar 16, 2016 · 1 comment

Comments

@chrise86
Copy link

Using browserify-rails 3.0.0 with the following in package.json:

"devDependencies": {
    "babelify": "^7.2.0",
    "browserify": "^10.2.4",
    "browserify-incremental": "^3.0.1",
    "react": "^0.13.3",
    "reactify": "^1.1.1"
  },

application.rb:

config.browserify_rails.commandline_options = "--transform babelify --presets [ es2015 react ]"

I'm getting:

SyntaxError: /Users/chrisedwards/Sites/Personal/railsapp/app/assets/javascripts/components/notifications/notification_menu.jsx: Unexpected token (51:11)

which is pointing to:

  render() {
    return <span onClick={this.onClick} className="navbar-text"> <-- Pointing to this line
      <i className="fa fa-bell-o fa-fw fa-lg"></i>
    </span>
  }
@mtyeh411
Copy link

mtyeh411 commented Nov 1, 2016

do you need the parentheses in the return statement? ie,

render() {
    return (
      <span onClick={this.onClick} className="navbar-text"> <-- Pointing to this line
        <i className="fa fa-bell-o fa-fw fa-lg"></i>
       </span>
    )
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants