Cancel a React Modal with Escape Key or External Click

Lou Mauget Articles, Development Technologies & Tools, React, Tutorial 1 Comment

Web application users are accustomed to canceling a popup (aka dialog or modal) by pressing the escape key, and many modals can even cancel if the user clicks outside it. How does a React developer code that without a plumbing mess between the modal and every visible component beneath it? How do you cancel a React modal with an escape key or external click?

I’m glad you asked because I have an answer. In this blog, I’ll show a pair of easy-to-use custom React hooks that simplify the task.

Learn Svelte by Making a Word Puzzle: Part 2, Reactivity

James Slaughter Articles, Development Technologies & Tools, JavaScript, Learning Svelte, Tutorial Leave a Comment

So far in this multi-part series, we’ve used Svelte to make the frontend of a Word Puzzle Game, but it does not receive user input, yet. That doesn’t make for a very fun game!

In Part 2 of this series, we’re going to make our game a little more functional. We’ll accomplish the following tasks: (1) allow users to guess a word, (2) manage state for the guesses, and (3) track the correctness of each letter in each guess.

By the end of this post, we will be one step closer to having a Svelte-based, fully functional Word Puzzle Game! Without further ado, let’s get started.

React Hooks Form

React Hook Form

Braden Niswonger Articles, Development Technologies & Tools, React Leave a Comment

In this blog, we will explore React Hook Form, an extremely lightweight and effective form building library using React. This open-source, third-party library has no dependencies and can be integrated with most existing forms or libraries. It provides the ability to subscribe to individual components, limiting the frequency of re-renders and making it more efficient.

Below, we will learn some of the basic usages of React Hook Form, some more in-depth features, and then look at an example form integrated with an existing UI library.