diff --git a/README.md b/README.md index 7827389..dfad001 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,10 @@ Report any issues or bugs to ## Changelog +### 5.0.0 +- Update react from 16.5.0 to 16.6.3 +- Fix deprecation of `componentWillReceiveProps` + ### 4.3.0 - Update handlebar dependency diff --git a/package-lock.json b/package-lock.json index 1a9927d..f8c9f9d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "react-stomp", - "version": "4.3.0", + "version": "5.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -7840,9 +7840,9 @@ } }, "react": { - "version": "16.9.0", - "resolved": "https://registry.npmjs.org/react/-/react-16.9.0.tgz", - "integrity": "sha512-+7LQnFBwkiw+BobzOF6N//BdoNw0ouwmSJTEm9cglOOmsg/TMiFHZLe2sEoN5M7LgJTj9oHH0gxklfnQe66S1w==", + "version": "16.13.0", + "resolved": "https://registry.npmjs.org/react/-/react-16.13.0.tgz", + "integrity": "sha512-TSavZz2iSLkq5/oiE7gnFzmURKZMltmi193rm5HEoUDAXpzT9Kzw6oNZnGoai/4+fUnm7FqS5dwgUL34TujcWQ==", "dev": true, "requires": { "loose-envify": "^1.1.0", @@ -7851,15 +7851,27 @@ } }, "react-dom": { - "version": "16.9.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.9.0.tgz", - "integrity": "sha512-YFT2rxO9hM70ewk9jq0y6sQk8cL02xm4+IzYBz75CQGlClQQ1Bxq0nhHF6OtSbit+AIahujJgb/CPRibFkMNJQ==", + "version": "16.13.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.13.0.tgz", + "integrity": "sha512-y09d2c4cG220DzdlFkPTnVvGTszVvNpC73v+AaLGLHbkpy3SSgvYq8x0rNwPJ/Rk/CicTNgk0hbHNw1gMEZAXg==", "dev": true, "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1", "prop-types": "^15.6.2", - "scheduler": "^0.15.0" + "scheduler": "^0.19.0" + }, + "dependencies": { + "scheduler": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.19.0.tgz", + "integrity": "sha512-xowbVaTPe9r7y7RUejcK73/j8tt2jfiyTednOvHbA8JoClvMYCp+r8QegLwK/n8zWQAtZb1fFnER4XLBZXrCxA==", + "dev": true, + "requires": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + } } }, "react-is": { diff --git a/package.json b/package.json index 5c672e9..0988261 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-stomp", - "version": "4.3.0", + "version": "5.0.0", "description": "React websocket component with STOMP over SockJS", "main": "./dist/client.js", "nyc": { @@ -62,8 +62,8 @@ "mocha": "^6.0.0", "nyc": "^14.0.0", "prop-types": "^15.6.2", - "react": "^16.8.1", - "react-dom": "^16.8.1", + "react": "^16.13.0", + "react-dom": "^16.13.0", "sinon": "^8.0.0" }, "dependencies": { diff --git a/src/client.jsx b/src/client.jsx index 343251c..de3e04e 100644 --- a/src/client.jsx +++ b/src/client.jsx @@ -7,7 +7,7 @@ import difference from 'lodash/difference' /** * React component for SockJS-client with STOMP messaging protocol. * - * @version 4.1.0 + * @version 5.0.0 * @author [lahsivjar] (https://github.com/lahsivjar) * @see {@link https://stomp.github.io/|STOMP} * @see {@link https://github.com/sockjs/sockjs-client|StompJS} @@ -120,7 +120,9 @@ class SockJsClient extends React.Component { return false } - componentWillReceiveProps (nextProps) { + /* eslint camelcase: ["error", {allow: ["UNSAFE_componentWillReceiveProps"]}] */ + + UNSAFE_componentWillReceiveProps (nextProps) { if (this.state.connected) { // Subscribe to new topics difference(nextProps.topics, this.props.topics) @@ -269,9 +271,9 @@ class SockJsClient extends React.Component { * @param {Object} [opt_headers={}] additional headers for underlying STOMP client * @public */ - sendMessage = (topic, msg, opt_headers = {}) => { + sendMessage = (topic, msg, optHeaders = {}) => { if (this.state.connected) { - this.client.send(topic, opt_headers, msg) + this.client.send(topic, optHeaders, msg) } else { throw new Error('Send error: SockJsClient is disconnected') }