diff --git a/client/app/bundles/comments/components/CommentBox/CommentBox.jsx b/client/app/bundles/comments/components/CommentBox/CommentBox.jsx
index 68611457..edcb4cd1 100644
--- a/client/app/bundles/comments/components/CommentBox/CommentBox.jsx
+++ b/client/app/bundles/comments/components/CommentBox/CommentBox.jsx
@@ -1,4 +1,5 @@
-import React, { PropTypes } from 'react';
+import React from 'react';
+import PropTypes from 'prop-types';
import Immutable from 'immutable';
import ActionCable from 'actioncable';
import _ from 'lodash';
@@ -15,13 +16,13 @@ class CommentBox extends BaseComponent {
static propTypes = {
pollInterval: PropTypes.number.isRequired,
actions: PropTypes.shape({
- fetchComments: React.PropTypes.function,
+ fetchComments: PropTypes.function,
}),
data: PropTypes.shape({
- isFetching: React.PropTypes.boolean,
- isSaving: React.PropTypes.boolean,
- submitCommentError: React.PropTypes.string,
- $$comments: React.PropTypes.arrayOf(CommentPropTypes),
+ isFetching: PropTypes.boolean,
+ isSaving: PropTypes.boolean,
+ submitCommentError: PropTypes.string,
+ $$comments: PropTypes.arrayOf(CommentPropTypes),
}).isRequired,
intl: intlShape.isRequired,
};
diff --git a/client/app/bundles/comments/components/CommentBox/CommentForm/CommentForm.jsx b/client/app/bundles/comments/components/CommentBox/CommentForm/CommentForm.jsx
index 5b49b3de..12dd88da 100644
--- a/client/app/bundles/comments/components/CommentBox/CommentForm/CommentForm.jsx
+++ b/client/app/bundles/comments/components/CommentBox/CommentForm/CommentForm.jsx
@@ -1,7 +1,8 @@
// NOTE: https://github.com/react-bootstrap/react-bootstrap/issues/1850 seesm to require string
// refs and not the callback kind.
/* eslint-disable react/no-find-dom-node, react/no-string-refs */
-import React, { PropTypes } from 'react';
+import React from 'react';
+import PropTypes from 'prop-types';
import ReactDOM from 'react-dom';
import Col from 'react-bootstrap/lib/Col';
import FormControl from 'react-bootstrap/lib/FormControl';
diff --git a/client/app/bundles/comments/components/CommentBox/CommentList/Comment/Comment.jsx b/client/app/bundles/comments/components/CommentBox/CommentList/Comment/Comment.jsx
index 8f2d9fa1..37b4e9b6 100644
--- a/client/app/bundles/comments/components/CommentBox/CommentList/Comment/Comment.jsx
+++ b/client/app/bundles/comments/components/CommentBox/CommentList/Comment/Comment.jsx
@@ -1,5 +1,6 @@
import BaseComponent from 'libs/components/BaseComponent';
-import React, { PropTypes } from 'react';
+import React from 'react';
+import PropTypes from 'prop-types';
import marked from 'marked';
import css from './Comment.scss';
diff --git a/client/app/bundles/comments/components/CommentBox/CommentList/CommentList.jsx b/client/app/bundles/comments/components/CommentBox/CommentList/CommentList.jsx
index afdc67fb..6ccdc857 100644
--- a/client/app/bundles/comments/components/CommentBox/CommentList/CommentList.jsx
+++ b/client/app/bundles/comments/components/CommentBox/CommentList/CommentList.jsx
@@ -1,7 +1,8 @@
import Alert from 'react-bootstrap/lib/Alert';
import BaseComponent from 'libs/components/BaseComponent';
import Immutable from 'immutable';
-import React, { PropTypes } from 'react';
+import React from 'react';
+import PropTypes from 'prop-types';
import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
import _ from 'lodash';
diff --git a/client/app/bundles/comments/components/CommentScreen/CommentScreen.jsx b/client/app/bundles/comments/components/CommentScreen/CommentScreen.jsx
index 44e53e1f..2c6e9b27 100644
--- a/client/app/bundles/comments/components/CommentScreen/CommentScreen.jsx
+++ b/client/app/bundles/comments/components/CommentScreen/CommentScreen.jsx
@@ -1,4 +1,5 @@
-import React, { PropTypes } from 'react';
+import React from 'react';
+import PropTypes from 'prop-types';
import BaseComponent from 'libs/components/BaseComponent';
diff --git a/client/app/bundles/comments/components/NavigationBar/CommentsCount.jsx b/client/app/bundles/comments/components/NavigationBar/CommentsCount.jsx
index 115231f5..4749c972 100644
--- a/client/app/bundles/comments/components/NavigationBar/CommentsCount.jsx
+++ b/client/app/bundles/comments/components/NavigationBar/CommentsCount.jsx
@@ -1,4 +1,5 @@
-import React, { PropTypes } from 'react';
+import React from 'react';
+import PropTypes from 'prop-types';
const href = 'https://github.com/shakacode/react_on_rails/blob/master/README.md#multiple-react-' +
'components-on-a-page-with-one-store';
diff --git a/client/app/bundles/comments/components/NavigationBar/NavigationBar.jsx b/client/app/bundles/comments/components/NavigationBar/NavigationBar.jsx
index 827aa4cb..6d496f70 100644
--- a/client/app/bundles/comments/components/NavigationBar/NavigationBar.jsx
+++ b/client/app/bundles/comments/components/NavigationBar/NavigationBar.jsx
@@ -3,7 +3,8 @@
import classNames from 'classnames';
import _ from 'lodash';
-import React, { PropTypes } from 'react';
+import React from 'react';
+import PropTypes from 'prop-types';
import CommentsCount from './CommentsCount';
import * as paths from '../../constants/paths';
diff --git a/client/app/bundles/comments/components/TestReactRouterRedirect/TestReactRouterRedirect.jsx b/client/app/bundles/comments/components/TestReactRouterRedirect/TestReactRouterRedirect.jsx
index 3cfe4fbc..ea9b22d7 100644
--- a/client/app/bundles/comments/components/TestReactRouterRedirect/TestReactRouterRedirect.jsx
+++ b/client/app/bundles/comments/components/TestReactRouterRedirect/TestReactRouterRedirect.jsx
@@ -1,20 +1,29 @@
import React from 'react';
+import { Redirect } from 'react-router-dom';
import BaseComponent from 'libs/components/BaseComponent';
export default class TestReactRouterRedirect extends BaseComponent {
- static checkAuth(nextState, replace) {
+
+ static checkAuth() {
// Hard code this to demonstrate the effect
const notAuthorized = true;
- if (notAuthorized) {
- replace({ pathname: '/', state: { redirectFrom: nextState.location.pathname } });
- }
+ return notAuthorized;
}
render() {
- return (
-
Nope.
- );
- }
+ if (TestReactRouterRedirect.checkAuth()) {
+ return (
+
+ );
+ }
+ return Nope.
;
+ }
}
diff --git a/client/app/bundles/comments/containers/NavigationBarContainer.jsx b/client/app/bundles/comments/containers/NavigationBarContainer.jsx
index cf65c514..361086f1 100644
--- a/client/app/bundles/comments/containers/NavigationBarContainer.jsx
+++ b/client/app/bundles/comments/containers/NavigationBarContainer.jsx
@@ -1,4 +1,5 @@
-import React, { PropTypes } from 'react';
+import React from 'react';
+import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import BaseComponent from 'libs/components/BaseComponent';
diff --git a/client/app/bundles/comments/containers/NonRouterCommentsContainer.jsx b/client/app/bundles/comments/containers/NonRouterCommentsContainer.jsx
index eea52532..6a1a16df 100644
--- a/client/app/bundles/comments/containers/NonRouterCommentsContainer.jsx
+++ b/client/app/bundles/comments/containers/NonRouterCommentsContainer.jsx
@@ -1,4 +1,5 @@
-import React, { PropTypes } from 'react';
+import React from 'react';
+import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import BaseComponent from 'libs/components/BaseComponent';
diff --git a/client/app/bundles/comments/containers/RouterCommentsContainer.jsx b/client/app/bundles/comments/containers/RouterCommentsContainer.jsx
index eb01405f..3e30b282 100644
--- a/client/app/bundles/comments/containers/RouterCommentsContainer.jsx
+++ b/client/app/bundles/comments/containers/RouterCommentsContainer.jsx
@@ -1,4 +1,5 @@
-import React, { PropTypes } from 'react';
+import React from 'react';
+import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { IntlProvider } from 'react-intl';
diff --git a/client/app/bundles/comments/layout/Layout.jsx b/client/app/bundles/comments/layout/Layout.jsx
index dcae7823..d4c0dbfd 100644
--- a/client/app/bundles/comments/layout/Layout.jsx
+++ b/client/app/bundles/comments/layout/Layout.jsx
@@ -1,10 +1,11 @@
-import React, { PropTypes } from 'react';
-import { IndexLink, Link } from 'react-router';
-import BaseComponent from 'libs/components/BaseComponent';
+import React, { Component } from 'react';
+import PropTypes from 'prop-types';
+import { NavLink as Link } from 'react-router-dom';
import './Layout.scss';
-export default class Layout extends BaseComponent {
+/* eslint-disable react/prefer-stateless-function */
+export default class Layout extends Component {
static propTypes = {
children: PropTypes.object.isRequired,
@@ -17,9 +18,9 @@ export default class Layout extends BaseComponent {
-
-
+
Comments (Root URL)
-
+
-
diff --git a/client/app/bundles/comments/routes/routes.jsx b/client/app/bundles/comments/routes/routes.jsx
index 8ae88e9e..da0bfa78 100644
--- a/client/app/bundles/comments/routes/routes.jsx
+++ b/client/app/bundles/comments/routes/routes.jsx
@@ -1,23 +1,27 @@
import React from 'react';
-import { Route, IndexRoute } from 'react-router';
+import { Route, Switch } from 'react-router-dom';
import Layout from '../layout/Layout';
import TestReactRouter from '../components/TestReactRouter/TestReactRouter';
import TestReactRouterRedirect from '../components/TestReactRouterRedirect/TestReactRouterRedirect';
import RouterCommentsContainer from '../containers/RouterCommentsContainer';
export default (
-
-
-
-
-
+
+
+
+
+
+
+
);
diff --git a/client/app/bundles/comments/startup/ClientRouterApp.jsx b/client/app/bundles/comments/startup/ClientRouterApp.jsx
index 795f334b..7bc193fc 100644
--- a/client/app/bundles/comments/startup/ClientRouterApp.jsx
+++ b/client/app/bundles/comments/startup/ClientRouterApp.jsx
@@ -2,25 +2,17 @@
import React from 'react';
import { Provider } from 'react-redux';
import ReactOnRails from 'react-on-rails';
-import { syncHistoryWithStore } from 'react-router-redux';
-import { Router, browserHistory } from 'react-router';
-
+import { BrowserRouter } from 'react-router-dom';
import routes from '../routes/routes';
export default (_props, _railsContext) => {
const store = ReactOnRails.getStore('routerCommentsStore');
- // Create an enhanced history that syncs navigation events with the store
- const history = syncHistoryWithStore(
- browserHistory,
- store,
- );
-
return (
-
+
{routes}
-
+
);
};
diff --git a/client/app/bundles/comments/startup/ServerRouterApp.jsx b/client/app/bundles/comments/startup/ServerRouterApp.jsx
index 8f6bfb64..73215df7 100644
--- a/client/app/bundles/comments/startup/ServerRouterApp.jsx
+++ b/client/app/bundles/comments/startup/ServerRouterApp.jsx
@@ -1,9 +1,8 @@
// Compare to ../ClientRouterApp.jsx
import React from 'react';
import { Provider } from 'react-redux';
-import { match, RouterContext } from 'react-router';
+import { StaticRouter } from 'react-router';
import ReactOnRails from 'react-on-rails';
-
import routes from '../routes/routes';
export default (_props, railsContext) => {
@@ -11,16 +10,8 @@ export default (_props, railsContext) => {
let error;
let redirectLocation;
- let routeProps;
const { location } = railsContext;
- // See https://github.com/reactjs/react-router/blob/master/docs/guides/ServerRendering.md
- match({ routes, location }, (_error, _redirectLocation, _routeProps) => {
- error = _error;
- redirectLocation = _redirectLocation;
- routeProps = _routeProps;
- });
-
// This tell react_on_rails to skip server rendering any HTML. Note, client rendering
// will handle the redirect. What's key is that we don't try to render.
// Critical to return the Object properties to match this { error, redirectLocation }
@@ -28,10 +19,19 @@ export default (_props, railsContext) => {
return { error, redirectLocation };
}
+ // Allows components to add properties to the object to store
+ // information about the render.
+ const context = {};
+
// Important that you don't do this if you are redirecting or have an error.
return (
-
+
+ {routes}
+
);
};
diff --git a/client/package.json b/client/package.json
index c4a26df1..9596c925 100644
--- a/client/package.json
+++ b/client/package.json
@@ -77,14 +77,16 @@
"node-sass": "^4.5.2",
"node-uuid": "^1.4.8",
"postcss-loader": "^1.3.3",
- "react": "^15.4.1",
- "react-addons-css-transition-group": "^15.4.1",
- "react-bootstrap": "^0.30.8",
- "react-dom": "^15.4.1",
- "react-intl": "^2.2.2",
+ "prop-types": "^15.5.10",
+ "react": "^15.6.1",
+ "react-addons-css-transition-group": "^15.6.0",
+ "react-bootstrap": "^0.31.2",
+ "react-dom": "^15.6.1",
+ "react-intl": "^2.3.0",
"react-on-rails": "^8.0.6-rc.1",
- "react-redux": "^4.4.6",
- "react-router": "^3.0.0",
+ "react-redux": "^5.0.5",
+ "react-router": "^4.1.2",
+ "react-router-dom": "^4.1.2",
"react-router-redux": "^4.0.7",
"redux": "^3.6.0",
"redux-thunk": "^2.2.0",
diff --git a/client/yarn.lock b/client/yarn.lock
index b74cbc36..69f96096 100644
--- a/client/yarn.lock
+++ b/client/yarn.lock
@@ -1203,6 +1203,10 @@ chai@^3.5.0:
deep-eql "^0.1.3"
type-detect "^1.0.0"
+chain-function@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/chain-function/-/chain-function-1.0.0.tgz#0d4ab37e7e18ead0bdc47b920764118ce58733dc"
+
chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
@@ -1514,6 +1518,14 @@ create-hmac@^1.1.0, create-hmac@^1.1.2:
create-hash "^1.1.0"
inherits "^2.0.1"
+create-react-class@^15.5.3, create-react-class@^15.6.0:
+ version "15.6.0"
+ resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.0.tgz#ab448497c26566e1e29413e883207d57cfe7bed4"
+ dependencies:
+ fbjs "^0.8.9"
+ loose-envify "^1.3.1"
+ object-assign "^4.1.1"
+
cross-spawn@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-3.0.1.tgz#1256037ecb9f0c5f79e3d6ef135e30770184b982"
@@ -2292,7 +2304,7 @@ faye-websocket@~0.11.0:
dependencies:
websocket-driver ">=0.5.1"
-fbjs@^0.8.1, fbjs@^0.8.4:
+fbjs@^0.8.4, fbjs@^0.8.9:
version "0.8.12"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.12.tgz#10b5d92f76d45575fd63a217d4ea02bea2f8ed04"
dependencies:
@@ -2642,13 +2654,14 @@ hawk@~3.1.3:
hoek "2.x.x"
sntp "1.x.x"
-history@^3.0.0:
- version "3.3.0"
- resolved "https://registry.yarnpkg.com/history/-/history-3.3.0.tgz#fcedcce8f12975371545d735461033579a6dae9c"
+history@^4.5.1, history@^4.6.0:
+ version "4.6.3"
+ resolved "https://registry.yarnpkg.com/history/-/history-4.6.3.tgz#6d723a8712c581d6bef37e8c26f4aedc6eb86967"
dependencies:
invariant "^2.2.1"
loose-envify "^1.2.0"
- query-string "^4.2.2"
+ resolve-pathname "^2.0.0"
+ value-equal "^0.2.0"
warning "^3.0.0"
hmac-drbg@^1.0.0:
@@ -2868,7 +2881,7 @@ intl@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/intl/-/intl-1.2.5.tgz#82244a2190c4e419f8371f5aa34daa3420e2abde"
-invariant@^2.0.0, invariant@^2.1.0, invariant@^2.1.1, invariant@^2.2.0, invariant@^2.2.1:
+invariant@^2.0.0, invariant@^2.1.0, invariant@^2.1.1, invariant@^2.2.0, invariant@^2.2.1, invariant@^2.2.2:
version "2.2.2"
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360"
dependencies:
@@ -3092,6 +3105,10 @@ is-windows@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-0.2.0.tgz#de1aa6d63ea29dd248737b69f1ff8b8002d2108c"
+isarray@0.0.1:
+ version "0.0.1"
+ resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
+
isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
@@ -3335,7 +3352,7 @@ loader-utils@^1.0.0, loader-utils@^1.0.1, loader-utils@^1.0.2, loader-utils@^1.0
emojis-list "^2.0.0"
json5 "^0.5.0"
-lodash-es@^4.2.1:
+lodash-es@^4.2.0, lodash-es@^4.2.1:
version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.4.tgz#dcc1d7552e150a0640073ba9cb31d70f032950e7"
@@ -3482,7 +3499,7 @@ longest@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097"
-loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0:
+loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
dependencies:
@@ -4044,6 +4061,12 @@ path-to-regexp@0.1.7:
version "0.1.7"
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"
+path-to-regexp@^1.5.3:
+ version "1.7.0"
+ resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.7.0.tgz#59fde0f435badacba103a84e9d3bc64e96b9937d"
+ dependencies:
+ isarray "0.0.1"
+
path-type@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441"
@@ -4408,6 +4431,19 @@ promise@^7.0.1, promise@^7.1.1:
dependencies:
asap "~2.0.3"
+prop-types-extra@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/prop-types-extra/-/prop-types-extra-1.0.1.tgz#a57bd4810e82d27a3ff4317ecc1b4ad005f79a82"
+ dependencies:
+ warning "^3.0.0"
+
+prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.6, prop-types@^15.5.8:
+ version "15.5.10"
+ resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.10.tgz#2797dfc3126182e3a95e3dfbb2e893ddd7456154"
+ dependencies:
+ fbjs "^0.8.9"
+ loose-envify "^1.3.1"
+
proxy-addr@~1.1.3:
version "1.1.4"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-1.1.4.tgz#27e545f6960a44a627d9b44467e35c1b6b4ce2f3"
@@ -4542,7 +4578,7 @@ qs@6.4.0, qs@~6.4.0:
version "6.4.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233"
-query-string@^4.1.0, query-string@^4.2.2:
+query-string@^4.1.0:
version "4.3.2"
resolved "https://registry.yarnpkg.com/query-string/-/query-string-4.3.2.tgz#ec0fd765f58a50031a3968c2431386f8947a5cdd"
dependencies:
@@ -4593,12 +4629,11 @@ rc@^1.1.7:
minimist "^1.2.0"
strip-json-comments "~2.0.1"
-react-addons-css-transition-group@^15.4.1:
- version "15.4.2"
- resolved "https://registry.yarnpkg.com/react-addons-css-transition-group/-/react-addons-css-transition-group-15.4.2.tgz#b7828834dfa14229fe07750e331e8a8cb6fb7745"
+react-addons-css-transition-group@^15.6.0:
+ version "15.6.0"
+ resolved "https://registry.yarnpkg.com/react-addons-css-transition-group/-/react-addons-css-transition-group-15.6.0.tgz#69887cf6e4874d25cd66e22a699e29f0d648aba0"
dependencies:
- fbjs "^0.8.4"
- object-assign "^4.1.0"
+ react-transition-group "^1.2.0"
react-addons-test-utils@^15.5.1:
version "15.5.1"
@@ -4607,35 +4642,38 @@ react-addons-test-utils@^15.5.1:
fbjs "^0.8.4"
object-assign "^4.1.0"
-react-bootstrap@^0.30.8:
- version "0.30.8"
- resolved "https://registry.yarnpkg.com/react-bootstrap/-/react-bootstrap-0.30.8.tgz#4ceca8e138ce2351228c4a58d59db00c003ca9c0"
+react-bootstrap@^0.31.2:
+ version "0.31.2"
+ resolved "https://registry.yarnpkg.com/react-bootstrap/-/react-bootstrap-0.31.2.tgz#f59184676ecedfc4c572d29ffdd6f9126ea8fe6a"
dependencies:
babel-runtime "^6.11.6"
classnames "^2.2.5"
dom-helpers "^3.2.0"
invariant "^2.2.1"
keycode "^2.1.2"
- react-overlays "^0.6.12"
+ prop-types "^15.5.10"
+ prop-types-extra "^1.0.1"
+ react-overlays "^0.7.0"
react-prop-types "^0.4.0"
- uncontrollable "^4.0.1"
+ uncontrollable "^4.1.0"
warning "^3.0.0"
react-deep-force-update@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/react-deep-force-update/-/react-deep-force-update-1.0.1.tgz#f911b5be1d2a6fe387507dd6e9a767aa2924b4c7"
-react-dom@^15.4.1:
- version "15.4.2"
- resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-15.4.2.tgz#015363f05b0a1fd52ae9efdd3a0060d90695208f"
+react-dom@^15.6.1:
+ version "15.6.1"
+ resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-15.6.1.tgz#2cb0ed4191038e53c209eb3a79a23e2a4cf99470"
dependencies:
- fbjs "^0.8.1"
+ fbjs "^0.8.9"
loose-envify "^1.1.0"
object-assign "^4.1.0"
+ prop-types "^15.5.10"
-react-intl@^2.2.2:
- version "2.2.3"
- resolved "https://registry.yarnpkg.com/react-intl/-/react-intl-2.2.3.tgz#8eebb03cddc38b337ed22fab78037ab53a594270"
+react-intl@^2.3.0:
+ version "2.3.0"
+ resolved "https://registry.yarnpkg.com/react-intl/-/react-intl-2.3.0.tgz#e1df6af5667fdf01cbe4aab20e137251e2ae5142"
dependencies:
intl-format-cache "^2.0.5"
intl-messageformat "^1.3.0"
@@ -4646,12 +4684,13 @@ react-on-rails@^8.0.6-rc.1:
version "8.0.6-rc.1"
resolved "https://registry.yarnpkg.com/react-on-rails/-/react-on-rails-8.0.6-rc.1.tgz#6326e2b431351f9a9976bbf6a59b5e5b2fabd91d"
-react-overlays@^0.6.12:
- version "0.6.12"
- resolved "https://registry.yarnpkg.com/react-overlays/-/react-overlays-0.6.12.tgz#a079c750cc429d7db4c7474a95b4b54033e255c3"
+react-overlays@^0.7.0:
+ version "0.7.0"
+ resolved "https://registry.yarnpkg.com/react-overlays/-/react-overlays-0.7.0.tgz#531898ff566c7e5c7226ead2863b8cf9fbb5a981"
dependencies:
classnames "^2.2.5"
dom-helpers "^3.2.0"
+ prop-types "^15.5.8"
react-prop-types "^0.4.0"
warning "^3.0.0"
@@ -4668,27 +4707,41 @@ react-proxy@^1.1.7:
lodash "^4.6.1"
react-deep-force-update "^1.0.0"
-react-redux@^4.4.6:
- version "4.4.6"
- resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-4.4.6.tgz#4b9d32985307a11096a2dd61561980044fcc6209"
+react-redux@^5.0.5:
+ version "5.0.5"
+ resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-5.0.5.tgz#f8e8c7b239422576e52d6b7db06439469be9846a"
dependencies:
+ create-react-class "^15.5.3"
hoist-non-react-statics "^1.0.3"
invariant "^2.0.0"
lodash "^4.2.0"
+ lodash-es "^4.2.0"
loose-envify "^1.1.0"
+ prop-types "^15.5.10"
+
+react-router-dom@^4.1.2:
+ version "4.1.2"
+ resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-4.1.2.tgz#7f8a7ca868d32acadd19ca09543b40d26df8ec37"
+ dependencies:
+ history "^4.5.1"
+ loose-envify "^1.3.1"
+ prop-types "^15.5.4"
+ react-router "^4.1.1"
react-router-redux@^4.0.7:
version "4.0.8"
resolved "https://registry.yarnpkg.com/react-router-redux/-/react-router-redux-4.0.8.tgz#227403596b5151e182377dab835b5d45f0f8054e"
-react-router@^3.0.0:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/react-router/-/react-router-3.0.2.tgz#5a19156678810e01d81901f9c0fef63284b8a514"
+react-router@^4.1.1, react-router@^4.1.2:
+ version "4.1.2"
+ resolved "https://registry.yarnpkg.com/react-router/-/react-router-4.1.2.tgz#7ae027341abc42eb08ad9f7a8cac08d0563672ce"
dependencies:
- history "^3.0.0"
+ history "^4.6.0"
hoist-non-react-statics "^1.2.0"
- invariant "^2.2.1"
- loose-envify "^1.2.0"
+ invariant "^2.2.2"
+ loose-envify "^1.3.1"
+ path-to-regexp "^1.5.3"
+ prop-types "^15.5.4"
warning "^3.0.0"
react-transform-hmr@^1.0.4:
@@ -4698,13 +4751,25 @@ react-transform-hmr@^1.0.4:
global "^4.3.0"
react-proxy "^1.1.7"
-react@^15.4.1:
- version "15.4.2"
- resolved "https://registry.yarnpkg.com/react/-/react-15.4.2.tgz#41f7991b26185392ba9bae96c8889e7e018397ef"
+react-transition-group@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-1.2.0.tgz#b51fc921b0c3835a7ef7c571c79fc82c73e9204f"
+ dependencies:
+ chain-function "^1.0.0"
+ dom-helpers "^3.2.0"
+ loose-envify "^1.3.1"
+ prop-types "^15.5.6"
+ warning "^3.0.0"
+
+react@^15.6.1:
+ version "15.6.1"
+ resolved "https://registry.yarnpkg.com/react/-/react-15.6.1.tgz#baa8434ec6780bde997cdc380b79cd33b96393df"
dependencies:
- fbjs "^0.8.4"
+ create-react-class "^15.6.0"
+ fbjs "^0.8.9"
loose-envify "^1.1.0"
object-assign "^4.1.0"
+ prop-types "^15.5.10"
read-pkg-up@^1.0.1:
version "1.0.1"
@@ -4915,6 +4980,10 @@ resolve-from@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226"
+resolve-pathname@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-2.1.0.tgz#e8358801b86b83b17560d4e3c382d7aef2100944"
+
resolve-url-loader@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/resolve-url-loader/-/resolve-url-loader-2.0.2.tgz#c465e97ea0a4791f3961f766cea775ff2e3ceb8c"
@@ -5548,9 +5617,9 @@ unc-path-regex@^0.1.0:
version "0.1.2"
resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa"
-uncontrollable@^4.0.1:
- version "4.0.3"
- resolved "https://registry.yarnpkg.com/uncontrollable/-/uncontrollable-4.0.3.tgz#06ec76cb9e02914756085d9cea0354fc746b09b4"
+uncontrollable@^4.1.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/uncontrollable/-/uncontrollable-4.1.0.tgz#e0358291252e1865222d90939b19f2f49f81c1a9"
dependencies:
invariant "^2.1.0"
@@ -5649,6 +5718,10 @@ validate-npm-package-license@^3.0.1:
spdx-correct "~1.0.0"
spdx-expression-parse "~1.0.0"
+value-equal@^0.2.0:
+ version "0.2.1"
+ resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-0.2.1.tgz#c220a304361fce6994dbbedaa3c7e1a1b895871d"
+
vary@~1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.1.tgz#67535ebb694c1d52257457984665323f587e8d37"
diff --git a/spec/features/react_router_demo_spec.rb b/spec/features/react_router_demo_spec.rb
new file mode 100644
index 00000000..e3bc96ee
--- /dev/null
+++ b/spec/features/react_router_demo_spec.rb
@@ -0,0 +1,26 @@
+require "rails_helper"
+require "features/shared/contexts"
+
+feature "React Router Routes", js: true do
+ context "Root URL", page: :main do
+ it "shows comments section" do
+ click_link "Comments (Root URL)"
+ expect(page).to have_selector("h2", text: "Comments")
+ end
+ end
+ context "/react-router URL", page: :main do
+ it "shows 'React Router is working!' message" do
+ click_link "Test React Router ('/react-router')"
+ expect(page).to have_selector("h1", text: "React Router is working!")
+ end
+ end
+ context "/react-router/redirect URL", page: :main do
+ before { click_link "Test Redirect (url to '/react-router/redirect' which goes to root '/')" }
+ it "shows comments section" do
+ expect(page).to have_selector("h2", text: "Comments")
+ end
+ it "shows redirect message" do
+ expect(page).to have_selector(".bg-success", text: "You have been redirected from/react-router/redirect")
+ end
+ end
+end