UNSAFE_INLINE_HANDLER: Event handler from a string
Este conteúdo não está disponível em sua língua ainda.
| Severity | Fault | Stage |
|---|---|---|
| error | customer (the source package) | build output |
What it means
Section titled “What it means”The component sets an inline event handler from a string (setAttribute(“onclick”, …), el.onclick = “…” or an SVG <set attributeName=“onclick”>), a javascript: URL or a data: HTML document in href, src or action, an xlink:href built at run time, or opens a javascript: URL with window.open (the window it opens is same-origin with the page), which the browser runs as code, an eval in disguise (rule inline-handler).
How to fix
Section titled “How to fix”Pass a function: onClick={() => …} in JSX, or addEventListener(“click”, handler).