Skip to content

Commit

Permalink
Update comment
Browse files Browse the repository at this point in the history
  • Loading branch information
fushar committed Dec 4, 2023
1 parent 0c35547 commit 29ed5b4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const getThemeType = ( theme?: Theme ) => {

export const usePreviewingTheme = () => {
const previewingThemeSlug = useSelect( ( select ) => {
// Subscribe to the core store, so that previewingThemeSlug can be updated when the theme is activated.
// We need this hack because the currentlyPreviewingTheme() function is not a hook.
// Subscribe to the core store, so that we can recompute `previewingThemeSlug` when the active theme changes.
// This is a workaround because we're not listening to the changes to the `wp_theme_preview` param in the URL.
select( 'core' );
return currentlyPreviewingTheme();
}, [] );
Expand Down

0 comments on commit 29ed5b4

Please sign in to comment.