Closed robcolburn closed 9 years ago
By default and for convenience the component uses browser cookies, but you can override this by setting the get
, set
and del
props on the component.
@olahol, Looking into this, it does seem rather difficult to make genetic. The difficulty seems to be because we need access to the {{request}} which is not local in NodeJs.
You could theoretically write those methods back somewhere before rendering react, and pass them down. Makes sense.
I'm curious if you've been able to pull this off with any 3rd party A/B vendors, or is it just internal?
I'm sorry I completely forgot about this issue, I have addressed some of the concerns about the isomorphic aspect of the component in version 0.4.0
. Check out the example in the readme and see if it works for you.
Why not use react-cookies? It's isomorphic and you can plug the cookies from req.cookies to save the context and then draw isomorphically from react-cookies rather than document cookies... @olahol
@thebigredgeek , looks nice, I will look into it.
I was excited by the name and the example, but looking at the code it appears you're using the DOM for cookies. How do you manage that back on the server?