useReload
Provides logic to reload the page or refresh a component state programmatically.
Usage
The useReload
hook is useful when you need to programmatically trigger a reload of a page or specific content. Below is a basic example to see how this hook works in reloading components or entire windows.
Hard Reload
In certain cases, you may need to perform a hard reload of the page to refresh all content or reset the state. This section shows how to use useReload for performing a hard reload on the window
.
API References
useReload utilizes the location.reload()
method to initialize the current URL's reload location, such as creating a Refresh button whose style and layout you create yourself.
Source Codes
Full working code example, including necessary markup and styles. You can copy and paste this code directly to start using the component immediately.