From acdcf78e16b2c235b60c9d1cb038dfcd29dec701 Mon Sep 17 00:00:00 2001 From: Jonathan Samines Date: Mon, 15 Jan 2018 17:21:12 -0600 Subject: [PATCH] Update React development versions to React 16. Update test to avoid deprecated/removed features in React 16 --- package.json | 13 ++++++++----- test/fixtures/views/account.jsx | 17 +++++++---------- test/fixtures/views/app.jsx | 19 +++++++------------ test/fixtures/views/layout.jsx | 30 +++++++++++++----------------- test/fixtures/views/profile.jsx | 22 +++++++++------------- 5 files changed, 44 insertions(+), 57 deletions(-) diff --git a/package.json b/package.json index 074a921..fc06329 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,9 @@ "lint": "eslint .", "tape": "tape test/*.js | faucet" }, + "engines": { + "node": ">=4" + }, "repository": { "type": "git", "url": "https://github.com/paypal/react-engine" @@ -38,16 +41,16 @@ "express": "^4.12", "faucet": "0.0.1", "jsdom": "^9.2.1", - "react": "^15.3.2", - "react-dom": "^15.3.2", - "react-router": "^2.4.0", + "react": "^16.2.0", + "react-dom": "^16.2.0", + "react-router": "^3.2.0", "rewire": "^2.3.1", "sinon": "^1.14.1", "tape": "^4.6.0" }, "peerDependencies": { - "react": "^15.3.2", - "react-dom": "^15.3.2" + "react": "15.x.x || 16.x.x", + "react-dom": "15.x.x || 16.x.x" }, "keywords": [ "react", diff --git a/test/fixtures/views/account.jsx b/test/fixtures/views/account.jsx index 9541ca1..ea5b1d6 100644 --- a/test/fixtures/views/account.jsx +++ b/test/fixtures/views/account.jsx @@ -17,13 +17,10 @@ var React = require('react'); -module.exports = React.createClass({ - - render: function() { - return ( -
-

{this.props.name || 'Joshua'}

-
- ); - } -}); +module.exports = (props) => { + return ( +
+

{props.name || 'Joshua'}

+
+ ); +}; diff --git a/test/fixtures/views/app.jsx b/test/fixtures/views/app.jsx index b4f9843..e35b098 100644 --- a/test/fixtures/views/app.jsx +++ b/test/fixtures/views/app.jsx @@ -16,17 +16,12 @@ 'use strict'; var React = require('react'); -var Router = require('react-router'); var Layout = require('./layout.jsx'); -module.exports = React.createClass({ - - render: function render() { - - return ( - - {this.props.children} - - ); - } -}); +module.exports = (props) => { + return ( + + {props.children} + + ); +}; diff --git a/test/fixtures/views/layout.jsx b/test/fixtures/views/layout.jsx index effd245..9e5721c 100644 --- a/test/fixtures/views/layout.jsx +++ b/test/fixtures/views/layout.jsx @@ -17,20 +17,16 @@ var React = require('react'); -module.exports = React.createClass({ - - render: function() { - - return ( - - - - {this.props.title || 'Hello, world!'} - - - {this.props.children} - - - ); - } -}); +module.exports = (props) => { + return ( + + + + {props.title || 'Hello, world!'} + + + {props.children} + + + ); +}; diff --git a/test/fixtures/views/profile.jsx b/test/fixtures/views/profile.jsx index 6d6be86..517befc 100644 --- a/test/fixtures/views/profile.jsx +++ b/test/fixtures/views/profile.jsx @@ -18,16 +18,12 @@ var React = require('react'); var Layout = require('./layout.jsx'); -module.exports = React.createClass({ - - render: function render() { - - return ( - -
-

{this.props.name}

-
-
- ); - } -}); +module.exports = (props) => { + return ( + +
+

{props.name}

+
+
+ ); +};