Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Turbolinks unmount event from before-visit to before-render #709

Merged
merged 10 commits into from
Feb 11, 2017
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Contributors: please follow the recommendations outlined at [keepachangelog.com]

## [Unreleased]
*Please add entries here for your pull requests.*
### Fixed
- 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)

## [6.5.0] - 2017-01-31
### Added
Expand Down
2 changes: 1 addition & 1 deletion docs/additional-reading/turbolinks.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ TURBO: reactOnRailsPageLoaded

Turbolinks 5:
```
TURBO: WITH TURBOLINKS 5: document turbolinks:before-cache and turbolinks:load handlers installed. (program)
TURBO: WITH TURBOLINKS 5: document turbolinks:before-render and turbolinks:load handlers installed. (program)
TURBO: reactOnRailsPageLoaded
```

Expand Down
2 changes: 1 addition & 1 deletion docs/api/javascript-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The best source of docs is the main [ReactOnRails.js](../../node_package/src/Rea
* Main entry point to using the react-on-rails npm package. This is how Rails will be able to
* find you components for rendering. Components get called with props, or you may use a
* "generator function" to return a React component or an object with the following shape:
* { renderedHtml, redirectLocation, error }.
* { renderedHtml, redirectLocation, error }.
* @param components (key is component name, value is component)
*/
register(components)
Expand Down
4 changes: 2 additions & 2 deletions node_package/src/clientStartup.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ export function clientStartup(context) {
if (turbolinksVersion5()) {
debugTurbolinks(
'USING TURBOLINKS 5: document added event listeners ' +
' turbolinks:before-visit and turbolinks:load.');
document.addEventListener('turbolinks:before-visit', reactOnRailsPageUnloaded);
'turbolinks:before-render and turbolinks:load.');
document.addEventListener('turbolinks:before-render', reactOnRailsPageUnloaded);
document.addEventListener('turbolinks:load', reactOnRailsPageLoaded);
} else {
debugTurbolinks(
Expand Down