-
-
Notifications
You must be signed in to change notification settings - Fork 699
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
User Component name doesn't change when specified in config #602
Comments
I found name, displayName and resolver-key(important). This is simple code. import { Editor, Element, Frame, UserComponent, useNode } from "@craftjs/core"
const MyUserComponent: UserComponent = () => {
const { node } = useNode((node) => ({ node }))
return (
<div>
<div>Name: {node.data.name}</div>
<div>DisplayName: {node.data.displayName}</div>
</div>
)
}
// Code completion works for both!
MyUserComponent.craft = { name: "RealName", displayName: "DisplayName" }
export default function MyEditor() {
return (
<Editor resolver={{ RealName: MyUserComponent }}>
<Frame>
<Element is={MyUserComponent} />
</Frame>
</Editor>
)
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
User Component name doesn't reflect what is specified in the UserComponentConfig.
To Reproduce
Expected behavior
The component shows
MyUserComponent
but I expectCustomName
Your environment
The text was updated successfully, but these errors were encountered: