Optimize State Updates
The intention is to show optimized states, between prevParams and newParams, not re-render the page if the newParams is equal prevParams
The search params is NOT made with useSearchParams/Next.js like this:
import {(useSearchParams, useRouter, usePathname)} from
'next/navigation'
It means if refresh the page it will give a issue next.js;
On console tab to test code line 27:
Click 3 times in the button submit and after click back and forward history button in the browser.
To test code line 47:
To see the re-rendering the message on console, select params and click in the submit button
Test it by comment and uncoment the optimized code lines
The Joy of Owning a Dog
Discover the happiness and companionship that comes with owning a dog.
Caring for Your Feline Friend
Learn how to provide the best care for your beloved cat (not caterpillar).
The Fascinating World of Caterpillars
Explore the incredible transformation of caterpillars into beautiful butterflies.
Training Your Dog: Tips and Tricks
Discover effective techniques to train your dog and build a strong bond.
Cat Breeds: Choosing the Perfect Companion
Find the ideal cat breed that matches your lifestyle and personality.
The Life Cycle of a Butterfly
Learn about the stages of a butterfly's life and its importance in nature.
Dog Health: Common Issues and Prevention
Discover how to keep your dog healthy and prevent common health problems.
Cat Behavior: Understanding Your Feline Friend
Gain insights into the behavior of cats, why some hate dogs, and how to strengthen your bond with them.
Gardening for Caterpillars: Creating a Butterfly Haven
Learn how to create a garden that attracts caterpillars and supports butterfly populations.
Dog-Friendly Activities: Fun Adventures for You and Your Pup
Discover exciting activities to enjoy with your dog and create lasting memories.