Skip to content

Commit

Permalink
chore: add comment about style loss in view transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
wobsoriano committed Oct 16, 2024
1 parent 18c28d4 commit ce98122
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/clerk-js/src/core/clerk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,13 @@ export class Clerk implements ClerkInterface {
return this.navigate(to);
}

/**
* This clears the emotion cache, which is particularly useful
* when working with Astro View Transitions to prevent style loss during page navigation.
*
* For more info on the issue, see:
* https://github.com/withastro/astro/issues/11000
*/
__internal_flushEmotionCache() {
return this.#componentControls?.ensureMounted().then(controls => controls.flushEmotionCache());
}
Expand Down

0 comments on commit ce98122

Please sign in to comment.