Skip to content

Commit

Permalink
Migrate from React.createClass to create-react-class
Browse files Browse the repository at this point in the history
  • Loading branch information
aesopwolf committed Jun 16, 2017
1 parent a20da5b commit 7dc68fc
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "formsy-react",
"version": "0.19.3",
"version": "0.19.4",
"description": "A form input builder and validator for React JS",
"repository": {
"type": "git",
Expand Down Expand Up @@ -31,6 +31,7 @@
"babel-preset-es2015": "^6.6.0",
"babel-preset-react": "^6.5.0",
"babel-preset-stage-2": "^6.5.0",
"create-react-class": "^15.6.0",
"jsdom": "^6.5.1",
"nodeunit": "^0.9.1",
"prop-types": "^15.5.10",
Expand Down
7 changes: 6 additions & 1 deletion release/formsy-react.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion release/formsy-react.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/Decorator.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
var React = global.React || require('react');
var createReactClass = require('create-react-class');
var Mixin = require('./Mixin.js');
module.exports = function () {
return function (Component) {
return React.createClass({
return createReactClass({
mixins: [Mixin],
render: function () {
return React.createElement(Component, {
Expand Down
3 changes: 2 additions & 1 deletion src/HOC.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
var React = global.React || require('react');
var createReactClass = require('create-react-class');
var Mixin = require('./Mixin.js');
module.exports = function (Component) {
return React.createClass({
return createReactClass({
displayName: 'Formsy(' + getDisplayName(Component) + ')',
mixins: [Mixin],

Expand Down
3 changes: 2 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var PropTypes = require('prop-types');
var React = global.React || require('react');
var createReactClass = require('create-react-class');
var Formsy = {};
var validationRules = require('./validationRules.js');
var formDataToObject = require('form-data-to-object');
Expand All @@ -22,7 +23,7 @@ Formsy.addValidationRule = function (name, func) {
validationRules[name] = func;
};

Formsy.Form = React.createClass({
Formsy.Form = createReactClass({
displayName: 'Formsy',
getInitialState: function () {
return {
Expand Down

0 comments on commit 7dc68fc

Please sign in to comment.