Continuously Deploying Next.js Website to DigitalOcean Using GitHub ActionsUpdated on · 7 min read|
In this post, we'll dive into the automation of a Next.js website deployment to DigitalOcean using GitHub Actions. We'll discuss what GitHub Actions are and how they can be utilized to continuously deploy modifications to a remote server. This approach reduces the requirement for manual intervention and minimizes downtime. By the conclusion of this post, you'll have a robust understanding of how to automate your deployment workflow and achieve faster, more reliable deployments with ease.
Mocking the Window Object In Jest TestsUpdated on · 6 min read|
In this article, we'll explore the best practices for mocking the window object in Jest, using a simple function that retrieves a language code from a page URL as an example.
Typing React Context In TypeScriptUpdated on · 5 min read|
In this article, we'll see how to type React context in TypeScript. We explore the process of creating a theme context supporting dark and light themes, addressing type-related challenges along the way.
Testing Select Components with React Testing LibraryUpdated on · 7 min read|
Learn how to test Select components with React Testing Library, including native selects, synchronous and asynchronous react-select components, and best practices for accessibility. Explore code examples and tips for testing custom select components in React.
Add a Dynamic Sitemap to Next.js 13 Website Using Pages or App DirectoryUpdated on · 6 min read|
In this post, we will explore how to add a dynamic sitemap to a Next.js 13 website using both the 'pages' and 'app' directories. A sitemap is a file that lists all the pages of a website and helps search engines understand the structure of the site. By the end of this post, you will have a fully functional dynamic sitemap for your Next.js 13 website.
Productivity Benefits of Integrating ChatGPT Into the Front-End Development ProcessUpdated on · 8 min read|
Display Warning for Unsaved Form Data on Page ExitUpdated on · 6 min read|
Advanced Multistep Forms with React Hook FormUpdated on · 6 min read|
In a previous post, we built a basic multistep registration form using React and React Hook Form. In this article, we'll expand upon that foundation by implementing improvements, such as enabling data saving during step navigation and enhancing the visual representation of each step's state.
Build a Multistep Form With React Hook FormUpdated on · 8 min read|
Multistep forms a.k.a. wizard or funnel forms have a wide range of uses. They are most common when collecting different types of information into one data structure but are also useful to break down very large forms into the less user-intimidating multistep process. In this post, we'll build a basic multistep registration form, which collects the user's info and then presents it in a confirmation view, which can be reviewed and edited before the submission.
The Most Common Mistakes When Using ReactUpdated on · 11 min read|
Discover common React mistakes that developers make when using hooks, managing state, and rendering components. Learn how to identify and fix these mistakes to improve your application's performance and maintainability.
Tips on Becoming a Self-taught DeveloperUpdated on · 10 min read|
Lately, I have been asked increasingly often for some tips on how to become a self-taught developer, so I thought I'd write a post about it, reflecting on my experience and pointing out the things I'd do differently. In this article, I'll try to give general advice on how to improve for those considering or maybe already on the way to becoming self-taught software developers. It should be noted that the focus of the post is on front-end development since that's what I did; however, a majority of the advice can be applied to becoming a software engineer, irrespective of focus.
Improving React Testing Library TestsUpdated on · 10 min read|
Properly written tests not only help prevent regressions and buggy code, but in the case of React Testing Library, they also improve the accessibility of components and the overall user experience. In this post, we'll explore how to get the most out of your React Testing Library tests. I'll provide a collection of what I consider to be best practices and tips on how to avoid common mistakes with React Testing Library.
Add a Blog to Your Django WebsiteUpdated on · 6 min read|
Learn how to seamlessly integrate a fully functional and customizable blog into your existing Django website with this step-by-step tutorial, covering CRUD functionality, views, templates, and more.
Simplifying Connected Props with Redux and TypeScriptUpdated on · 4 min read|
Learn how to simplify connected props with Redux and TypeScript by using the ConnectedProps helper type. In this article, we'll walk through a concrete example and show you how to automatically infer the types of connected props from mapStateToProps and mapDispatchToProps. This will help you avoid manual type declaration and improve the maintainability of your app.
TypeScript: Typing Form Events In ReactUpdated on · 9 min read|
Handling events in React is very close to how the events on DOM elements are handled. The biggest difference is, however, that React wraps the native DOM events into SyntheticEvent, making them behave slightly differently than the native events. Consequently, typing form events in React is not the same as native events. In this post, we'll see how to type form events in React on the example of a simple component as well as discuss the most common pitfalls.
TypeScript: Typing React UseRef HookUpdated on · 5 min read|
Discover how to effectively type the useRef hook in TypeScript for React applications that require imperative DOM manipulation. Learn best practices, common pitfalls, and practical examples, such as controlling the focus state of an input element.
React Hook Form: Working with Multipart Form Data and File UploadsUpdated on · 6 min read|
Learn how to handle file uploads and multipart form data in React applications using React Hook Form. This tutorial demonstrates adding file input fields, working with FormData API, and submitting form data.
Testing React Hook Form With React Testing LibraryUpdated on · 8 min read|
React Hook Form has emerged as a popular and efficient library for managing form state and validation in React applications. It simplifies handling form inputs, reduces boilerplate code, and provides a performant solution for form management. However, testing these forms efficiently and accurately is just as important as implementing them.
Managing Forms with React Hook FormUpdated on · 9 min read|
Working with forms in React is notoriously difficult, particularly when there are dynamic fields involved. There exist several libraries that make the whole process easier. One such library is React Hook Form. In this post, we talk about the basics of React Hook Form and learn how to use it to simplify form management in your React applications.
TypeScript Template Literal Types: Practical Use-Cases for Improved Code QualityUpdated on · 4 min read|
Explore practical use-cases of TypeScript template literal types to enhance code safety and maintainability. Learn to leverage advanced type features for more expressive, robust, and easy-to-manage applications.
Testing Firestore Locally with Firebase EmulatorsUpdated on · 4 min read|
Running Firestore operations on a local database is an essential aspect of efficient Firebase development. In this tutorial, we'll guide you through the process of setting up and testing Firestore operations using a Firestore local database with the help of Firebase Emulator.
Create an Interactive Table of Contents for a Next.js Blog with RemarkUpdated on · 9 min read|
A well-organized and easily navigable table of contents significantly enhances the user experience, simplifying the process for readers to find the information they need. In this post, we'll go through the necessary steps to create an interactive table of contents for a Next.js blog using Remark, a powerful Markdown processor.
Optimize Redux Development: Simplify Boilerplate Creation with Code Generators and Plop.jsUpdated on · 6 min read|
Many developers seek ways to simplify their Redux development workflow and improve efficiency. In this article, we'll explore how to speed up your Redux development by automating the process of scaffolding boilerplate code with Plop.js code generators. We'll cover the best practices for using Plop.js in your Redux projects, how it can help you reduce boilerplate, and streamline your development process.
Speed Up Your React Developer Workflow with Plop.js Code GeneratorsUpdated on · 8 min read|
Copy to Clipboard Button In MDX with Next.js and Rehype Pretty CodeUpdated on · 6 min read|
This tutorial will guide you on how to create a 'copy to clipboard' button for the code snippets processed with Rehype Pretty Code plugin for syntax highlighting in Next.js. We'll be using Next.js 13+ with the 'app' directory enabled. By the end of this post, you'll be able to streamline code sharing and enhance the user experience on your Next.js website. In fact, this blog uses the exact functionality we'll be creating, so you can see the end result in action.
Enzyme vs React Testing Library: A Migration GuideUpdated on · 14 min read|
This blog post provides a basic comparison of both libraries and presents a migration guide based on code samples from each library. We'll write tests for the Tic-Tac-Toe game from an earlier post using Enzyme and then transform them into React Testing Library tests.
Build a Tic-Tac-Toe Game with TypeScript, React and MinimaxUpdated on · 12 min read|
In this tutorial we will build a Tic-Tac-Toe game with TypeScript, React, React Hooks, and style it using Styled Components library. Additionally, we'll use the Minimax algorithm to power the AI moves. The final code is available on both GitHub and CodeSandbox.
Building Component Library with Docz and LernaUpdated on · 8 min read|
Component libraries are all the rage these days, with many companies rolling out their own solutions or sticking to a bunch of open source alternatives. Leveraging a component library for UI development, particularly in large teams, has a lot of cool benefits. It allows to take full advantage of modular and reusable UI components, which brings increased speed of development and unifies styles across multiple teams and apps.