O'Reilly logo

Learning React by Kirupa Chinnathambi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

12. Accessing DOM Elements

There will be times when you want to access properties and methods on an HTML element directly. In our React-colored world where JSX represents everything that is good and pure about markup, why would you ever want to deal directly with the horribleness that is HTML? As you will find out (if you haven’t already), there are many cases where dealing with HTML elements through the JavaScript DOM API directly is easier than fiddling with “the React way” of doing things.

To highlight one such situation, take a look at the Colorizer example in Figure 12-1.

Image

Figure 12-1 Colorizer example.

If you have access to a browser, you ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required