Skip to main content

Posts

Featured

Sitecore headless - Few use cases for useEffect hook in the application head

If you use a framework like ReactJS, you probably don't need an introduction about hooks. Out of  all the hooks, useEffect will sweep your feet off the floor. This is because of useEffect' power and capability to run side effects. Personally speaking, useEffect seemed like a swiss knife to me since anything I couldn't resolve using CSS / Javascript especially in lines of DOM manipulation, i normally looked upto useEffect and it never failed to disappoint me. In this note, I've covered a few such scenarios so that in future, when you encounter complex scenarios, you would then know which hook to approach as a last resort. Note that most of the scenarios listed here are technically similar since they deal with adding/removing css or some kind of html DOM manipulation but I wanted to cover this as a note in order to look at the variety of scenarios possible. Now, the advantage of ReactJS is, you can either add the useEffect code to layout.tsx as-is (not liked by purists si...

Latest Posts

Images in public folder display 404 once deployed to vercel?

Convert Sitecore Form Email Body to valid JSON

My Sitecore community contribution statistics for 2025

Scaffolded Visual Studio Project for SC2025-004 hotfix

REST API that will auto publish the Sitecore item and then push the item to the initial workflow state

Azure Service Bus Consumer Without Changing Messaging Connection - Sitecore 9.3

Sitecore 9.3 on Windows 11 Pro and SQL Server 2022 with encrypted connection

PowerShell Script - establish SQL Server connection encryption for Sitecore 10.4.1 successful connectivity