Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: compact react lazy latest version. #86

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/click-to-react-component/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "module",
"name": "click-to-react-component",
"version": "1.1.0",
"version": "1.1.1",
"description": "Option+Click your React components in your browser to open the source file in VS Code",
"exports": "./src/index.js",
"types": "src/types.d.ts",
Expand Down
5 changes: 4 additions & 1 deletion packages/click-to-react-component/src/ContextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ export const ContextMenu = React.forwardRef(
padding: 5px;
border-radius: 4px;
font-size: 13px;
max-width: 50vw;
}

[data-click-to-component-contextmenu] button:focus,
Expand Down Expand Up @@ -351,7 +352,9 @@ export const ContextMenu = React.forwardRef(
${Object.entries(props).map(
([prop, value]) => html`
${' '}
<var key=${prop} title="${value}">${prop}</var>
<var key=${prop} title="${String(value)}"
>${prop}</var
>
`
)}
${'>'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,16 @@ export function getDisplayNameForInstance(instance) {
case 11: // ForwardRef
return 'React.forwardRef'

case 15: // MemoComponent
case 14: // MemoComponent
case 15: // MemoComponent or LazyComponent in react>16
// Attempt to get name from wrapped component
return elementType.type.name || 'React.memo'
return (
elementType.type?.name ||
Symbol.keyFor?.(elementType.$$typeof) ||
'React.memo'
)

case 16: // LazyComponent
case 16: // LazyComponent in react 16
return 'React.lazy'

default:
Expand Down