From 78c20b6cbdf2d529bb22142a4abd117d5fea6830 Mon Sep 17 00:00:00 2001 From: Steve Willard Date: Mon, 24 Apr 2017 20:56:28 -0400 Subject: [PATCH] Use 'create-react-class' to be compatible with React 15.5 --- .gitignore | 1 + package.json | 1 + src/fab-spinner.jsx | 3 ++- src/speed-dial-item.jsx | 5 +++-- src/speed-dial.jsx | 3 ++- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 9f11b75..ebe4b53 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .idea/ +node_modules \ No newline at end of file diff --git a/package.json b/package.json index e27b1fc..56aace5 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "homepage": "https://github.com/jampy/react-mui-speeddial#readme", "main": "./dist/index.js", "dependencies": { + "create-react-class": "^15.5.2" }, "peerDependencies": { "babel-polyfill": "^6.13.0", diff --git a/src/fab-spinner.jsx b/src/fab-spinner.jsx index 7c0ff45..b67175b 100644 --- a/src/fab-spinner.jsx +++ b/src/fab-spinner.jsx @@ -1,4 +1,5 @@ import React from 'react' +import createReactClass from 'create-react-class' const styles = { @@ -18,7 +19,7 @@ const styles = { }; -export const FabSpinner = React.createClass({ +export const FabSpinner = createReactClass({ render: function() { diff --git a/src/speed-dial-item.jsx b/src/speed-dial-item.jsx index 51979d8..aaac40f 100644 --- a/src/speed-dial-item.jsx +++ b/src/speed-dial-item.jsx @@ -1,5 +1,6 @@ import React from 'react' -import FloatingActionButton from 'material-ui/FloatingActionButton'; +import FloatingActionButton from 'material-ui/FloatingActionButton' +import createReactClass from 'create-react-class' const styles = { @@ -49,7 +50,7 @@ function getYPos(index) { return 81 + index * 56; } -export const SpeedDialItem = React.createClass({ +export const SpeedDialItem = createReactClass({ handleTouchTap(ev) { this.props.onCloseRequest(); diff --git a/src/speed-dial.jsx b/src/speed-dial.jsx index 99d722c..749351b 100644 --- a/src/speed-dial.jsx +++ b/src/speed-dial.jsx @@ -1,4 +1,5 @@ import React from 'react' +import createReactClass from 'create-react-class' import FloatingActionButton from 'material-ui/FloatingActionButton'; import { FabSpinner } from './fab-spinner'; @@ -12,7 +13,7 @@ const styles = { }; -export const SpeedDial = React.createClass({ +export const SpeedDial = createReactClass({ getInitialState() { return {