Hi all, what is the best way to find out if react is rendering on the client or the server? All the examples I found use reat's own internals
var canUseDOM = require('react/lib/ExecutionEnvironment').canUseDOM;
From what I've read, this is considered to be a bad practice since it is likely to break...
Any suggestions?
Cheers
JS
Other viable ways of figuring it out are:
Ajar
Technology is not enough. It has to serve an agenda. What's yours?
Found it:
var canUseDOM = !!( typeof window !== 'undefined' && window.document && window.document.createElement );