File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
src/components/Navigation Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 1
1
// Import External Dependencies
2
2
import React from 'react' ;
3
3
import Banner from 'react-banner' ;
4
- import DocSearch from 'docsearch.js' ;
5
4
6
5
// Import Components
7
6
import Link from '../Link/Link' ;
@@ -55,10 +54,14 @@ export default class Navigation extends React.Component {
55
54
}
56
55
57
56
componentDidMount ( ) {
58
- DocSearch ( {
59
- apiKey : 'fac401d1a5f68bc41f01fb6261661490' ,
60
- indexName : 'webpack-js-org' ,
61
- inputSelector : '.navigation-search__input'
62
- } ) ;
57
+ if ( window . document !== undefined ) {
58
+ const DocSearch = require ( 'docsearch.js' ) ;
59
+
60
+ DocSearch ( {
61
+ apiKey : 'fac401d1a5f68bc41f01fb6261661490' ,
62
+ indexName : 'webpack-js-org' ,
63
+ inputSelector : '.navigation-search__input'
64
+ } ) ;
65
+ }
63
66
}
64
67
}
You can’t perform that action at this time.
0 commit comments