Skip to content

Commit

Permalink
Merge pull request #614 from vtex-apps/feature/lazy-pixels
Browse files Browse the repository at this point in the history
Hydration flag
  • Loading branch information
lbebber authored Jun 24, 2021
2 parents ee39505 + 5f649eb commit 3917968
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- `window.__HAS_HYDRATED__` flag, intended for lazy pixels, but which can be used elsewhere.

## [8.128.4] - 2021-04-22

Expand Down
7 changes: 7 additions & 0 deletions react/core/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,13 @@ function start() {
}))
} else {
setLazyCookie(runtime.workspaceCookie)
maybeRenderPromise
.then(() => {
;(window as any).__HAS_HYDRATED__ = true
})
.catch((error) => {
console.error('Error during hydration', error)
})
console.log(
'Welcome to Render! Want to look under the hood? https://careers.vtex.com'
)
Expand Down

0 comments on commit 3917968

Please sign in to comment.