aidenybai / aidenybai/react-scan

It doesn't work in multi-window setup based on `window.open` and `createPortal`

Đang mở
#433 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
21.8k
Fork
390
Merge trung bình
23 phút
Pull request đã merge (30 ngày)
1

Mô tả

I want to add react-scan to Electron app that renders into multiple windows from the same JavaScript thread using `const newWindow = window.open` and then `createPortal(, newWindow)`.

In that case react-scan seems not to work at all

https://pietrasiak.com/creating-multi-window-electron-apps-using-react-portals#aad5d08cfa4d413a8ff6979ebe267fa3

I've wrote article on quirks of this setup

eg.
- `instanceof HTMLElement` will not work as it should be `instanceof ownerWindow.HTMLElement`
- highlights div cannot be created like `document.createElement(), document.body.appendChil` - needs `ownerWindow.documentElement`
- it essentially needs one highlighter per window in which react fiber renders

I understand it is quite major edge case, so not expecting it to be adjusted, just wanted to let you know

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.