Skip to content

Instantly share code, notes, and snippets.

@taisyo7333
Last active February 21, 2017 08:27
Show Gist options
  • Save taisyo7333/1c429b64806c4addd844db0ac97e7bc9 to your computer and use it in GitHub Desktop.
Save taisyo7333/1c429b64806c4addd844db0ac97e7bc9 to your computer and use it in GitHub Desktop.
React / javascript:void(0) == > undefined

概要

  • "javascript:void(0)"をやるとeslintでエラーになる
/*eslint no-script-url: "error"*/

location.href = "javascript:void(0)";

どのように対応するか?

  • 下記のようには書ける。ただし挙動が変わる。マウスポインタを当てると文字列に下線表示される。 
<a href={undefined} ...> </a>

参考URL

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