Categories
React

A Quick Intro to useReducer() (with an Example)

useState is a nice and simple hook for managing state in functional components (as opposed to setState in class components). But as the complexities of your application grow, you’ll find yourself needing something a little more powerful.

Say “hello” to useReducer!

Categories
JavaScript Project React

A Tale of Two ‘To Do’ Apps: 5 Things I Learned

I recently followed two tutorials from the very endearing Dev Ed on YouTube where he created the very same To Do app in different ways; once in vanilla Javascript and again in React. It only took an hour or two to make each one, but it was a really interesting process.

Here’s what I learned…

Categories
GitHub React

Serving a Create React App Project via GitHub Pages

Being new to GitHub Pages, I experienced a couple of issues in the process of getting a Create React App project live.

Here’s how I got it working…

Categories
React

Quick Guide to React’s useEffect() Hook (with Examples)

The useEffect() hook is probably one of the more complex or difficult to understand hooks in React. However, it’s very powerful and is essentially a critical piece of the framework used when fetching data from APIs, using timers and more.

With that in mind, it’s worth getting your head around it.

Categories
React

React Refs & useRef() Explained (with Examples)

If we ever need to work with a DOM element directly (as opposed to managing state via React), Refs are what we need!

Categories
React

React Portals Explained (with Examples)

Let’s take a look at Portals – the handy way to get your component from A to B!

Categories
APIs ES6 JavaScript

Asynchronous Javascript: fetch, Promises and async / await

Understanding asynchronous javascript – and working with APIs generally – can really take your horizons to a whole new level. There are countless APIs out there that suddenly become available to you; whether that’s free datasets or triggering functionality in your favourite product.

The world is your lobster!

Categories
React

Managing an Input’s Value in the Parent’s State in React

Say you want to share the value of an input field with other components; how do you do that?

It’s actually really straightforward, however it’s something I find myself researching again and again every time I need to do it.

This is a simple example.

Categories
ES6 JavaScript

ES6 Arrow Functions Explained

Arrow functions are my personal favourite addition to Javascript that came along with ES6. Find out how to use them.

Categories
ES6 JavaScript

ES6 Template Literals (Template Strings) Explained

With ES6, we can do string concatenation in a more natural way that improves readability. It’s super simple!