Skip to content

Commit

Permalink
Change turbolinks mount event
Browse files Browse the repository at this point in the history
  • Loading branch information
szyablitsky committed Mar 19, 2017
1 parent bd974c0 commit 8ea8647
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Contributors: please follow the recommendations outlined at [keepachangelog.com]

## [Unreleased]
*Please add entries here for your pull requests.*

### Fixed
- Fixed error "The node you're attempting to unmount was rendered by another copy of React." [#706](https://github.com/shakacode/react_on_rails/issues/706) when navigating to cached page using Turbolinks [#763](https://github.com/shakacode/react_on_rails/pull/763) by [szyablitsky](https://github.com/szyablitsky).

## [6.8.0] - 2017-03-06
## Added
- Converted to Webpack v2 for generators, tests, and all example code. [#742](https://github.com/shakacode/react_on_rails/pull/742) by [justin808](https://github.com/justin808).
Expand All @@ -29,7 +33,7 @@ Commenting out this line addresses the issue:

```
config.i18n_dir = Rails.root.join("client", "app", "libs", "i18n")
```
```

### Added
- Allow using rake task to generate javascript locale files. The test helper automatically creates the localization files when needed. [#717](https://github.com/shakacode/react_on_rails/pull/717) by [JasonYCHuang](https://github.com/JasonYCHuang).
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-render and turbolinks:load handlers installed. (program)
TURBO: WITH TURBOLINKS 5: document turbolinks:before-render and turbolinks:render handlers installed. (program)
TURBO: reactOnRailsPageLoaded
```

Expand Down
6 changes: 3 additions & 3 deletions node_package/src/clientStartup.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ export function clientStartup(context) {
if (turbolinksVersion5()) {
debugTurbolinks(
'USING TURBOLINKS 5: document added event listeners ' +
'turbolinks:before-render and turbolinks:load.');
'turbolinks:before-render and turbolinks:render.');
document.addEventListener('turbolinks:before-render', reactOnRailsPageUnloaded);
document.addEventListener('turbolinks:load', reactOnRailsPageLoaded);
document.addEventListener('turbolinks:render', reactOnRailsPageLoaded);
} else {
debugTurbolinks(
'USING TURBOLINKS 2: document added event listeners page:before-unload and ' +
Expand All @@ -197,7 +197,7 @@ export function clientStartup(context) {
debugTurbolinks(
'NOT USING TURBOLINKS: DOMContentLoaded event, calling reactOnRailsPageLoaded',
);
reactOnRailsPageLoaded();
}
reactOnRailsPageLoaded();
});
}

0 comments on commit 8ea8647

Please sign in to comment.