Skip to content

Commit b7079ea

Browse files
author
William Meleyal
committed
log warning in development if we disable Turbolinks cache
1 parent fa158e0 commit b7079ea

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/assets/javascripts/react_ujs.js renamed to lib/assets/javascripts/react_ujs.js.erb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
(function(document, window, React) {
33
var CLASS_NAME_ATTR = 'data-react-class';
44
var PROPS_ATTR = 'data-react-props';
5+
var RAILS_ENV_DEVELOPMENT = <%= Rails.env == "development" %>;
56

67
// jQuery is optional. Use it to support legacy browsers.
78
var $ = (typeof jQuery !== 'undefined') && jQuery;
@@ -55,6 +56,10 @@
5556
} else {
5657
unmountEvent = 'page:receive';
5758
Turbolinks.pagesCached(0);
59+
60+
if (RAILS_ENV_DEVELOPMENT) {
61+
console.warn('The Turbolinks cache has been disabled (Turbolinks >= 2.4.0 is recommended). See https://github.com/reactjs/react-rails/issues/87 for more information.');
62+
}
5863
}
5964

6065
handleEvent('page:change', mountReactComponents);

0 commit comments

Comments
 (0)