---
title: "Discussion on \"Security Risks of Inline Event Handlers in React.js (And How to Avoid Them)\" | Hashnode"
description: "Discussion on \"Security Risks of Inline Event Handlers in React.js (And How to Avoid Them)\". If you’re a React.js developer, chances are you’ve dropped an inline event handler into your code without even thinking twice. It’s so easy to do! You might write something like this:\n<button onClick={() => alert('You clicked me!')}>Click Me</button>..."
url: "https://hashnode.com/posts/security-risks-of-inline-event-handlers-in-reactjs-and-how-to-avoid-them/66fd796ac446ebd7ccabf415"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Security Risks of Inline Event Handlers in React.js (And How to Avoid Them)](https://nikitasarkania.hashnode.dev/security-risks-of-inline-event-handlers-in-reactjs-and-how-to-avoid-them?utm_source=hashnode&utm_medium=feed)

If you’re a React.js developer, chances are you’ve dropped an inline event handler into your code without even thinking twice. It’s so easy to do! You might write something like this: <button onClick={() => alert('You clicked me!')}>Click Me</button>...

Oct 2, 2024 · 4 min read · nikitasarkania.hashnode.dev  
Read the article

-   [#reactsecurity](https://hashnode.com/tag/reactsecurity)
-   [#xss-attacks](https://hashnode.com/tag/xss-attacks)
-   [#xssprotection](https://hashnode.com/tag/xssprotection)
-   [#secure-coding](https://hashnode.com/tag/secure-coding)
-   [#secure-coding-practices](https://hashnode.com/tag/secure-coding-practices)
-   [#javascript-tips](https://hashnode.com/tag/javascript-tips)
-   [#react-best-practices](https://hashnode.com/tag/react-best-practices)
-   [#front-end-security](https://hashnode.com/tag/front-end-security)

## Written by

[Nikita Sarkania](https://hashnode.com/@nikitasarkania)

@nikitasarkania · New Delhi, India

  
[View profile](https://hashnode.com/@nikitasarkania)

Software Developer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
