DEV Community

Andrii Fedyk
Andrii Fedyk

Posted on

Why inline events handler are bad in HTML and good in React?

Since you are a baby developer, always say don't use inline event handlers:

Event mdn says don't use those.

But in React, inline event handlers are fine:

<button onClick={bgChange}>Press me</button>
Enter fullscreen mode Exit fullscreen mode

Why?

Top comments (0)