diff --git a/package.json b/package.json index aea15ec..725fc19 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "storybook": "start-storybook -p 9001", "lint": "standard", "lint-fix": "standard --fix", - "test": "jest" + "test": "jest", + "prepare": "npm run build" }, "repository": { "type": "git", @@ -38,7 +39,7 @@ "dependencies": { "emotion": "^10.0.1", "prop-types": "^15.6.2", - "react-transition-group": "^2.5.0" + "react-transition-group": "^4.4.1" }, "devDependencies": { "@babel/cli": "^7.1.0", @@ -54,9 +55,9 @@ "babel-jest": "^23.6.0", "babel-loader": "^8.0.4", "jest": "^23.6.0", - "react": "^16.6.3", + "react": "^17.0.1", "react-addons-test-utils": "^15.6.2", - "react-dom": "^16.6.3", + "react-dom": "^17.0.1", "react-testing-library": "^5.3.1", "regenerator-runtime": "^0.13.1", "rimraf": "^2.6.2", @@ -66,8 +67,8 @@ "webpack-cli": "^3.1.2" }, "peerDependencies": { - "react": "^0.14 || ^15.0.0-rc || ^15.0 || ^16.0.0 || ^16.0", - "react-dom": "^0.14 || ^15.0.0-rc || ^15.0 || ^16.0.0 || ^16.0" + "react": "^0.14 || ^15.0.0-rc || ^15.0 || ^16.0.0 || ^16.0 || ^17.0", + "react-dom": "^0.14 || ^15.0.0-rc || ^15.0 || ^16.0.0 || ^16.0 || ^17.0" }, "standard": { "parser": "babel-eslint" diff --git a/src/LoadingOverlay.js b/src/LoadingOverlay.js index ddb711b..a1a002d 100644 --- a/src/LoadingOverlay.js +++ b/src/LoadingOverlay.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react' +import React, { Component, createRef } from 'react' import PropTypes from 'prop-types' import { CSSTransition } from 'react-transition-group' import { css, cx } from 'emotion' @@ -11,6 +11,7 @@ class LoadingOverlayWrapper extends Component { super(props) this.wrapper = React.createRef() this.state = { overflowCSS: {} } + this.nodeRef = createRef(); } componentDidMount () { @@ -82,6 +83,7 @@ class LoadingOverlayWrapper extends Component { classNames='_loading-overlay-transition' timeout={fadeSpeed} unmountOnExit + nodeRef={this.nodeRef} > {state => (
-
+
{spinner && ( typeof spinner === 'boolean' ?