react-component / react-component/image

使用 iframe 去访问一个使用了当前组件的页面,页面会报错

Open
#482 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
213
Forks
124
Avg merge
47m
Merged PRs (30d)
1

Description

报错如下:
Image

目测是以下代码导致:
https://github.com/react-component/image/blob/de622e336a4f9f52c6f49ab5093f820e6dfb5590/src/hooks/useMouseEvent.ts#L99-L125

示例:
内嵌页面为 Image 组件官网,切换侧边示例会复现上述错误
https://codesandbox.io/p/sandbox/jkt7tk

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CodeSandbox reproduction and embed the Image component documentation page in an iframe, then switch the sidebar examples to reproduce the error. Inspect src/hooks/useMouseEvent.ts lines 99-125 alongside the reported screenshot. Done means the embedded page no longer errors while changing examples, with behavior preserved outside an iframe.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.