Better Programming

Advice for programmers.

Follow publication

Member-only story

How onChange Differs Between React and Vanilla JavaScript

Moon
Better Programming
Published in
4 min readMar 23, 2020
Photo by Franck V. on Unsplash

Many people are using React in their projects. It’s one of the most popular and famous JavaScript frameworks in the world and I think its reputation will last for at least a few more years from now.

But there’s no perfection in the world, regardless of what it is. React is also one of those un-perfect products. Meaning, React is based on JavaScript. So, it supports almost every feature that exists in JavaScript.

However, I found a rather weird thing in React that made me think: “Why is it like this?” This is what I am going to talk about in this post — onChange, the JavaScript DOM event method.

Before Reading

  1. You should know React and how to handle the event handlers with JavaScript. If you don’t know them well, please read the relevant documentation first.
  2. For some people, this could be a topic that is too easy. But, for whoever React, Vue, or other JavaScript frameworks is the first battlefield they have been on with the weapon named JavaScript, such as junior web developers (sometimes seniors too), this might be quite an interesting topic.

How to Hang the Event Handler…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Moon
Moon

Written by Moon

Frontend React w/ Typescript developer based in S.Korea. Interested in UX/Testing/FE. mgyang95@gmail.com

Write a response