File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 7070 "react-dom" : " ^15.0.1"
7171 },
7272 "dependencies" : {
73+ "can-use-dom" : " ^0.1.0" ,
7374 "glamorous" : " ^3.23.3" ,
7475 "picturefill" : " ^3.0.2" ,
7576 "prop-types" : " ^15.5.10"
Original file line number Diff line number Diff line change 11import React from "react" ;
22import PropTypes from "prop-types" ;
3- import picturefill from "picturefill" ;
43import glamorous from "glamorous" ;
4+ import canUseDom from 'can-use-dom'
55
66const Img = glamorous . img ( ) ;
77
88class Picture extends React . PureComponent {
99 componentDidMount ( ) {
10- picturefill ( ) ;
10+ // c.f. https://github.com/scottjehl/picturefill/pull/556
11+ var picturefill ;
12+ try {
13+ picturefill = require ( 'picturefill' ) ;
14+ } catch ( x ) { }
15+
16+ if ( picturefill ) picturefill ( ) ; // browser
17+ // else node
1118 }
1219
1320 renderSources ( ) {
14- const ieVersion = document . documentMode ? document . documentMode : - 1 ;
21+ const ieVersion = canUseDom && document . documentMode ? document . documentMode : - 1 ;
1522 const { sources } = this . props ;
1623
1724 if ( sources == null ) {
You can’t perform that action at this time.
0 commit comments