Skip to content

fix: probing for forms that mount after the content script runs - #19

Open
Woodstock-IL-Cameras wants to merge 1 commit into
react-hook-form:mainfrom
Woodstock-IL-Cameras:patch-1
Open

Woodstock-IL-Cameras wants to merge 1 commit into
react-hook-form:mainfrom
Woodstock-IL-Cameras:patch-1

Conversation

@Woodstock-IL-Cameras

Copy link
Copy Markdown

Problem

content.ts posts INIT once at document_idle, and the page only announces itself in reply. Any DevTool mounting after that never hears it, a race with hydration for forms on the first paint, and never for anything rendered later. The panel then shows no React Hook Form while the in-app works.

Repro

Put on a form that isn't rendered on first paint.
Load the page, then render the form.
Panel says "This page isn't using the debug mode of React Hook Form"; reloading doesn't help.

Fix

Probe on an interval, paused while the tab is hidden.

Tradeoff

One WELCOME per form per probe. Having DevTool announce on mount would drop the polling, but needs a @hookform/devtools release.

Fixes #15. Not run as a loaded extension yet.

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.

Is the extension still working?

1 participant