Here's a custom hook for adding an autosave feature to ReactJS, without ending up with stale data. It uses setInterval to trigger the save, useEffect to keep things clean, and useRef to keep your save functions fresh.
How should we structure folders and files in Node.js? I was unhappy and slightly confused by the MVC approach, and wanted to move to a more colocation/feature-based structure. Here's what I came up with.
This post will cover how you can specify which queries to invalidate in ReactQuery with queryClient.invalidateQueries(). Here's how to target single queries, multiple queries, active queries and inactive queries.
When you deploy a new version of your single-page application (like ReactJS), you want your users to see it, right? But what if they have an old version open? Here's how you can force your user's browsers to refresh after releasing a new version of your web app.
If you try to render an array of objects in ReactJS, you might run into errors. Because ReactJS can't render the object. But you can loop over the array and turn it into something ReactJS can render, like a string or JSX.
Here's the conditional object property pattern. It uses the spread syntax (...) to conditionally add a property to an object, or an item to an array. Perfect when you (sometimes) want to add a key to an object.
In this blog post, I'll show you how and why I turned off conversion tracking in Google Ads and Microsoft Ads and started tracking ad conversions in Fathom Analytics instead. Bonus: No cookies!
After discovering link cloaking (and various services that manage, cloak and shorten affiliate links), I thought it would be pretty easy to set something basic up in Netlify for a static site. It was, and here's how you can do it!
Need a simple place to store content instead of pushing it to your git repository? Need a non-coder to be able to add content? Dropbox might be the answer!
When you generate an access token for the Dropbox API, it's usually short-lived and expires in 4 hours (or less for other users). Here's how to get a refresh token so that access is long-lived and doesn't expire.
Are you trying to use custom CSS with different list types, but running into problems with uppercase lists displaying as lowercase and visa-versa? Me too! Here's more info on the problem, and how you can fix it.
One thing I always found missing from markdown was different list types, specifically, letter and roman numeral lists. In this blog post, I'll add these list types to the popular MarkedJS markdown compiler.
Videos are pretty popular on the web these days. But what if your users want to add them to content? Here's how I added YouTube and Vimeo video embeds to Tiptap editor in ReactJS.
This year Ahrefs got rid of their 7 days for $7 trial, and don’t offer a free trial. But there are a few ways you can try out Ahrefs in 2022 without a paid account. Here are 3 of them.
Do you wonder how to connect your website to your server? Or maybe you're wondering about CDNs, API requests and serverless functions? And what's a static site? Here are 3 ways to connect the front-end of your website to the back-end.
Although isMounted is deprecated in ReactJS, maybe you need it to prevent memory leak errors in your application. Learn why there are better ways to solve this problem, and how to create an isMounted hook with useEffect if you still need one.
Moving over to ReactJS hooks? Good choice! But how do you use useEffect like componentDidMount? And how do you clean up your code afterwards? Learn how to create custom componentDidMount and componentWillUnmount hooks with useEffect.