Skip to content

Commit f4cb2ad

Browse files
authored
Merge pull request #140 from joshwnj/fix-config-for-ssr
Fix webpack config to work with next.js
2 parents 9c4e46e + 3610ece commit f4cb2ad

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

visibility-sensor.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ function normalizeRect(rect) {
1717
return rect;
1818
}
1919

20-
//let containmentPropType = typeof window !== 'undefined' ? PropTypes.instanceOf(window.Element) : PropTypes.any;
21-
2220
export default class VisibilitySensor extends React.Component {
2321
static defaultProps = {
2422
active: true,

webpack.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ module.exports = env => {
3030
path: path.resolve(__dirname, "dist"),
3131
filename: "[name].js",
3232
library: "react-visibility-sensor",
33-
libraryTarget: "umd"
33+
libraryTarget: "umd",
34+
globalObject: "this"
3435
};
3536
}
3637

0 commit comments

Comments
 (0)