Creating Custom React Hooks

For the past several weeks I’ve continued to explore the impact of React Hooks, an upcoming feature that is accessible via version 16.7.0-alpha.2. The two major improvements to React applications I’ve noticed are:

  • More simplicity, including less overall lines of code
  • Less code repetition, enabling adherence to the DRY (don’t repeat yourself) principle
  • Ability to modularize behaviors

Read More

React Context with Hooks

 

Note: React Hooks are still an experimental proposal. This post was written while Hooks were in React 16.7.0-alpha.2

I’ve spent the last several days experimenting the latest React Hooks features. It really has been a blast — so much code deletion when converting from the class stuff. Being a bit newer to React, I haven’t put together any huge applications with the library/framework (I say framework) and so I wasn’t really up to speed with using React Context. I spent a bit of time learning how to use context the classic way, and once I grasped that I decided I’d get a hang of the Hooks’ method: useContext. I wanted to document what I learned along the way by showing a small app I created using it.

 

Wait…What is Context in React?

Read More

Replacing React Classes with Hooks

Note: React Hooks are still an experimental proposal. This post was written while Hooks were in React 16.7.0-alpha.2

Note: Even if Hooks become an official React feature, they aren’t replacing classes, and the React docs don’t recommend huge rewrites replacing classes with Hooks.

I’m at the point in learning React where I’ve written some apps that use both class components and functional components. Admittedly, I should probably be focusing on using React’s core functionalities to develop larger apps before I start delving into its unreleased/experimental stuff, but I could not resist! After watching some talks from React Conf 2018, I decided to rewrite some of my current code using React Hooks. I wanted to write a post walking through a bit of my experience with it.

Read More

Learning React on AWS Cloud9

On my commute today I was listening to React Podcast with Michael Chan hosting, episode titled “Develop in the Cloud with Christina Holland.” Many tech podcasts I listen to are fantastic but often the subject matter is quite new to me and I tend to wish I could be looking things up as I listened or taking notes on things to check later, but driving doesn’t exactly cater to that behavior.

This podcast episode, however, had me nodding enthusiastically because it spoke about a topic that Christina gave a talk about at React Conf 2018: the cloud development process, and particularly React development in AWS Cloud9. I enjoyed the show thoroughly because I too have benefited from the beauty of developing in the cloud – in fact, AWS Cloud9 was really my true introduction to the cloud ecosystem. That’s right – it wasn’t EC2 or S3 or any other widely popular Amazon Web Service (although Cloud9 is backed by EC2.

What is AWS Cloud9?

Read More