Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.


    Scale Pixels for the Canvas with devicePixelRatio in React


    When working with HTML Canvas, HiDPI displays like Apple's Retina display require a bit of extra coaxing, to make sure they look crisp and sharp. This lesson covers how to write a method that automatically scales our component for the user's displays.

    Happily, once it's written, you can forget all about the DPI of your users' monitors. It's totally abstracted within our component.

    Learn more about creating the component here