GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: 修复React17选中组件bug · yourkeychen/lowcode-engine@750d282

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages
    • rax-simulator-renderer/src
      • renderer.ts
    • react-simulator-renderer/src
      • renderer.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/rax-simulator-renderer/src/renderer.ts‎

Copy file name to clipboardExpand all lines: packages/rax-simulator-renderer/src/renderer.ts
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ function cacheReactKey(el: Element): Element {
7373
if (REACT_KEY !== '') {
7474
return el;
7575
}
76-
REACT_KEY = Object.keys(el).find((key) => key.startsWith('__reactInternalInstance$')) || '';
76+
// react17 采用 __reactFiber 开头
77+
REACT_KEY = Object.keys(el).find(
78+
(key) => key.startsWith('__reactInternalInstance$') || key.startsWith('__reactFiber$'),
79+
) || '';
7780
if (!REACT_KEY && (el as HTMLElement).parentElement) {
7881
return cacheReactKey((el as HTMLElement).parentElement!);
7982
}
Collapse file

‎packages/react-simulator-renderer/src/renderer.ts‎

Copy file name to clipboardExpand all lines: packages/react-simulator-renderer/src/renderer.ts
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,10 @@ function cacheReactKey(el: Element): Element {
530530
if (REACT_KEY !== '') {
531531
return el;
532532
}
533-
REACT_KEY = Object.keys(el).find((key) => key.startsWith('__reactInternalInstance$')) || '';
533+
// react17 采用 __reactFiber 开头
534+
REACT_KEY = Object.keys(el).find(
535+
(key) => key.startsWith('__reactInternalInstance$') || key.startsWith('__reactFiber$'),
536+
) || '';
534537
if (!REACT_KEY && (el as HTMLElement).parentElement) {
535538
return cacheReactKey((el as HTMLElement).parentElement!);
536539
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.