First thanks for this marvelous library. I've been using it for years and work great.
Second, the last version 16.13.1 is breaking my node server.
This is what I getting in the server console
ReferenceError: performance is not defined
at new OnClickOutside(ClickOut) (webpack-internal:///../../node_modules/react-onclickoutside/dist/react-onclickoutside.cjs.js:262:29)
I could use react-onclickoutside to render my application in the server side without any problems, but performance is not defined by default in node environments, it has to be imported.
An alternative for performance.now() would be Date.now(), that is available everywhere, but maybe it doesn't have the precision needed.
Another alternative is make react-onclickoutside transparent when rendered in the server, just return the component it wraps, as in the server is not possible to make clicks.
Sounds like you're on a dead version of Node: which version are you using? performance has been in Node since v16, which is already old enough to have reached EOL.
First thanks for this marvelous library. I've been using it for years and work great.
Second, the last version 16.13.1 is breaking my node server.
This is what I getting in the server console
I could use react-onclickoutside to render my application in the server side without any problems, but
performance
is not defined by default in node environments, it has to be imported.An alternative for
performance.now()
would beDate.now()
, that is available everywhere, but maybe it doesn't have the precision needed.Another alternative is make react-onclickoutside transparent when rendered in the server, just return the component it wraps, as in the server is not possible to make clicks.