Skip to content

Commit 3a42291

Browse files
szyablitskyjustin808
authored andcommitted
Change Turbolinks unmount event from before-visit to before-render (#709)
* change turbolinks unmount event from before-visit to before-render * Addresses #706
1 parent 6209832 commit 3a42291

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Contributors: please follow the recommendations outlined at [keepachangelog.com]
55

66
## [Unreleased]
77
*Please add entries here for your pull requests.*
8+
### Fixed
9+
- Fixed issue [#706](https://github.com/shakacode/react_on_rails/issues/706) with "flickering" components when they are unmounted too early [#709](https://github.com/shakacode/react_on_rails/pull/709) by [szyablitsky](https://github.com/szyablitsky)
810

911
## [6.5.0] - 2017-01-31
1012
### Added

docs/additional-reading/turbolinks.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ TURBO: reactOnRailsPageLoaded
9494

9595
Turbolinks 5:
9696
```
97-
TURBO: WITH TURBOLINKS 5: document turbolinks:before-cache and turbolinks:load handlers installed. (program)
97+
TURBO: WITH TURBOLINKS 5: document turbolinks:before-render and turbolinks:load handlers installed. (program)
9898
TURBO: reactOnRailsPageLoaded
9999
```
100100

docs/api/javascript-api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The best source of docs is the main [ReactOnRails.js](../../node_package/src/Rea
66
* Main entry point to using the react-on-rails npm package. This is how Rails will be able to
77
* find you components for rendering. Components get called with props, or you may use a
88
* "generator function" to return a React component or an object with the following shape:
9-
* { renderedHtml, redirectLocation, error }.
9+
* { renderedHtml, redirectLocation, error }.
1010
* @param components (key is component name, value is component)
1111
*/
1212
register(components)

node_package/src/clientStartup.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ export function clientStartup(context) {
191191
if (turbolinksVersion5()) {
192192
debugTurbolinks(
193193
'USING TURBOLINKS 5: document added event listeners ' +
194-
' turbolinks:before-visit and turbolinks:load.');
195-
document.addEventListener('turbolinks:before-visit', reactOnRailsPageUnloaded);
194+
'turbolinks:before-render and turbolinks:load.');
195+
document.addEventListener('turbolinks:before-render', reactOnRailsPageUnloaded);
196196
document.addEventListener('turbolinks:load', reactOnRailsPageLoaded);
197197
} else {
198198
debugTurbolinks(

0 commit comments

Comments
 (0)