Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #43: React.createClass is deprecated (create-react-class) #45

Merged
merged 2 commits into from
Apr 24, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion amcharts3-react.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@

var id = 0;

AmCharts.React = React.createClass({
AmCharts.React = createReactClass({
getInitialState: function () {
return {
id: "__AmCharts_React_" + (++id) + "__",
Expand Down
3 changes: 2 additions & 1 deletion examples/webpack-export/example.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var React = require("react");
var ReactDOM = require("react-dom");
var createReactClass = require("create-react-class");
var AmCharts = require("@amcharts/amcharts3-react");


Expand All @@ -25,7 +26,7 @@ function generateData() {


// Component which contains the dynamic state for the chart
var Chart = React.createClass({
var Chart = createReactClass({
getInitialState: function () {
return {
dataProvider: generateData(),
Expand Down
3 changes: 2 additions & 1 deletion examples/webpack/example.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var React = require("react");
var ReactDOM = require("react-dom");
var createReactClass = require("create-react-class");
var AmCharts = require("@amcharts/amcharts3-react");


Expand All @@ -25,7 +26,7 @@ function generateData() {


// Component which contains the dynamic state for the chart
var Chart = React.createClass({
var Chart = createReactClass({
getInitialState: function () {
return {
dataProvider: generateData(),
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
if (typeof window !== "undefined") {
window.React = require("react");
window.ReactDOM = require("react-dom");
window.createReactClass = require("create-react-class");

require("./amcharts3-react.js");

Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@
"peerDependencies": {
"react": "^15.0.0",
"react-dom": "^15.0.0"
},
"dependencies": {
"create-react-class": "^15.5.2"
}
}