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

SyntaxError highlight code example in doc #47

Open
zhisme opened this issue Feb 2, 2024 · 1 comment · Fixed by hotwired/stimulus#749
Open

SyntaxError highlight code example in doc #47

zhisme opened this issue Feb 2, 2024 · 1 comment · Fixed by hotwired/stimulus#749

Comments

@zhisme
Copy link

zhisme commented Feb 2, 2024

I believe the example code is wrong.

highlight: function(event) {
  event.stopImmediatePropagation()
  // ...
}

we are inside class, but here it is written like object property and thus leading to SyntaxError: Unexpected identifier 'highlight'

should be corrected like in all other examples to class function definition

highlight(event) {
  event.stopImmediatePropagation()
  // ...
}

Stumbled upon working with documentation and copypasting to my project.

@marcoroth
Copy link
Member

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

Successfully merging a pull request may close this issue.

2 participants