I was working on react project. I was trying to reload a component when we click the reload button. I implemented the onClick function as given below. But it is reloading the whole window. I just want to reload only that class component, not the whole window. Can anyone help me to solve this?
refreshPage() {
window.location.reload();
}
componentDidMountfor some nested components as well? if you do, I see only possible solution to changekeyprop for topmost element in part you want to "update"