Skip to content

Commit

Permalink
Dynamically import iAPI router
Browse files Browse the repository at this point in the history
  • Loading branch information
DAreRodz committed Nov 13, 2024
1 parent 7b92a5e commit 204fa39
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/block-library/src/post-comments-form/view.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
/**
* WordPress dependencies
*/
import {
getContext,
getElement,
store,
navigate,
} from '@wordpress/interactivity';
import { getContext, getElement, store } from '@wordpress/interactivity';

const focusableSelectors = [
'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',
Expand Down Expand Up @@ -72,7 +67,10 @@ const { state } = store( 'core/comments', {
state.error =
dom.querySelector( '.wp-die-message' ).innerText;
} else {
yield navigate( response.url, {
const router = yield import(
'@wordpress/interactivity-router'
);
yield router.actions.navigate( response.url, {
html,
replace: true,
force: true,
Expand Down

0 comments on commit 204fa39

Please sign in to comment.