React js history.push 和 history.goBack 重新挂载之前的 page/component?

react js does history.push and history.goBack re mounts previous page/component?

我想将我的组件存储在调用 API 的位置并在堆栈中获取数据,因此在推送新组件然后返回时它应该保持其状态。

我没有使用任何导航包。

如果你想保存这些数据,我可能会建议你使用 redux 或使用 react context 来存储它