Basically, I have an object name as currentUser
generated from chatkit server. This object contains all the information as well as some methods of currently logged in user.
I want to pass this object as a prop to another component. I tried passing it to history.push
by initially stringify
ing it, but after parsing the object at receiving end, I am not able to access the methods of the object. I know that json.stringify
does exclude functions. Is there any other way that the stringify
method does include the methods as well?
Can anyone suggest another way for passing down this object as props. I have seen something called localStorage
. I am not sure how to use it. I would be grateful for any help.