react-cursor icon indicating copy to clipboard operation
react-cursor copied to clipboard

Support server side rendering

Open taou-maimai opened this issue 10 years ago • 5 comments
trafficstars

taou-maimai avatar Sep 02 '15 18:09 taou-maimai

I think your change is safe but I need to be certain, so I need to write some tests before I merge this. The memoizer stuff is hard to reason about and there are some weird edge cases to consider, like if there are multiple react roots on the page, so the caches have to be separate.

dustingetz avatar Sep 03 '15 17:09 dustingetz

If I went ahead and implemented https://github.com/dustingetz/react-cursor/issues/17, that would also fix your use case, right?

dustingetz avatar Sep 03 '15 17:09 dustingetz

Even if there are multiple react roots on the page(and Cursor.build is called on each root state), the function 'memoizeFactory()' in util.js is called only once (another issue?) and only one 'cache' exists. It makes no difference moving that to package scope.

So I think you can safely merge my change as a stop-gap and pub it to npm, then I am able to use 'react-cursor' in my project without changing library name in package.json to that of my fork.

taou-maimai avatar Sep 04 '15 03:09 taou-maimai

Published as 1.2.1

dustingetz avatar Sep 08 '15 15:09 dustingetz

Thanks.

taou-maimai avatar Sep 14 '15 03:09 taou-maimai