Skip to content

Wrap navigation events in withSyncEvent HOC to allow preventDefault - #51

Open
goldenapples wants to merge 1 commit into
mainfrom
use-with-sync-event
Open

Wrap navigation events in withSyncEvent HOC to allow preventDefault#51
goldenapples wants to merge 1 commit into
mainfrom
use-with-sync-event

Conversation

@goldenapples

Copy link
Copy Markdown
Contributor

Since WP 6.8, calling event.preventDefault() inside of an Interactivity API router is deprecated and unpredictable. In order to use a link inside an interactive router and prevent its default behavior, we have to wrap the handler in the wp.interactivity.withSyncEvent HOC.

See #49.

Since WP 6.8, calling event.preventDefault inside of an Interactivity
API router is deprecated and unpredictable. In order to use a link
inside an interactive router and prevent its default behavior, we have
to wrap the handler in the wp.interactivity.withSyncEvent HOC.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant