How to reload page in react js?
Hello Guys,
If you have question how to reload current page then you can show this demo. this first way to refresh component or page use javascript location reload method. in this demo i will show you reload current page onclick button. refresh react component using reload method.
If you have question How to refresh page on button click in react js then follow this tutorial. also refresh page after submit form. In react refresh page without reload using this demo.
/src/Reload.js
import React from 'react'
class Reload extends React.Component{
function refreshPage() {
window.location.reload(false);
}
render(){
return(
<div>
<button onClick={refreshPage}>Click to reload!</button>
</div>
)
}
}
export default Reload;
- How to Reactive Forms with Validation in Angular 18?
- Reactjs Props Example With Function and Class Components
- React Color Picker Example With Change Event
- How to Hide and Show Multiple Div in React ?
- React js File Upload Example With Axios
- How to Resize, Crop, Compress Images Before Uploading In ReactJS?
- How to Send Data From React to Node JS Express?
- Reactjs String Replace Example