Last active
April 6, 2019 15:57
-
-
Save tmbtech/92522d315d50ea5281d1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import ExecutionEnvironment from "react/lib/ExecutionEnvironment"; | |
React.createClass({ | |
componentWillMount() { | |
if (ExecutionEnvironment.canUseDOM) { | |
// ... has dom .. | |
} else { | |
//Server side rendering | |
} | |
}, | |
render() { | |
return <SomeComponent />; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment