mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 07:37:19 +02:00
feat(v2): add ExecutionEnvironment API (#2296)
* feat(v2): add ExecutionEnvironment API * remove redundant code
This commit is contained in:
parent
e6562859fd
commit
d974aa9c2a
6 changed files with 77 additions and 21 deletions
|
@ -5,8 +5,10 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment';
|
||||
|
||||
export default (function() {
|
||||
if (typeof window === 'undefined') {
|
||||
if (!ExecutionEnvironment.canUseDOM) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue