Skip to content

Refactor React#1684

Draft
davidjbradshaw wants to merge 4 commits into
devfrom
dev-react-refactore
Draft

Refactor React#1684
davidjbradshaw wants to merge 4 commits into
devfrom
dev-react-refactore

Conversation

@davidjbradshaw

Copy link
Copy Markdown
Owner

No description provided.

Comment thread packages/react/use-resizer.ts Dismissed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the @iframe-resizer/react wrapper by extracting the iframe-resizer setup/teardown and forwarded-ref imperative API wiring into two dedicated React hooks, simplifying the main component implementation.

Changes:

  • Extracted iframe-resizer initialization/logging/cleanup into useResizer.
  • Extracted forwardRef imperative handle wiring into useForwardedRef.
  • Reduced packages/react/index.tsx to a small component that composes the hooks and renders the <iframe>.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/react/index.tsx Replaced inline effect + imperative handle logic with hook composition.
packages/react/use-resizer.ts New hook encapsulating resizer setup, logging group initialization, and cleanup.
packages/react/use-forwarded-ref.ts New hook encapsulating useImperativeHandle methods exposed via forwarded ref.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/react/use-resizer.ts Outdated
Comment thread packages/react/use-forwarded-ref.ts Outdated
davidjbradshaw and others added 3 commits June 18, 2026 12:04
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@davidjbradshaw
davidjbradshaw marked this pull request as draft June 18, 2026 11:19
getIframeResizer().sendMessage(message, targetOrigin)
},
}),
[iframeRef],
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.

3 participants