I have a page in my react where a user can edit a document. But I want to be able to save that data in the event they press the back button. So far I\'ve tried this