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 TextNode#createDOM types: allow editor parameter in subclasses #5425

Merged
merged 1 commit into from
Jan 6, 2024

Conversation

thorn0
Copy link
Contributor

@thorn0 thorn0 commented Dec 27, 2023

Without this, using this parameter in a subclass leads to:

Property 'createDOM' in type 'MyTextNode' is not assignable to the same property in base type 'TextNode'.
  Type '(config: EditorConfig, editor: LexicalEditor) => HTMLElement' is not assignable to type '(config: EditorConfig) => HTMLElement'.
    Target signature provides too few arguments. Expected 2 or more, but got 1.ts(2416)

Or is it intentional and for some reason text nodes shouldn't use editor in createDOM?

I made it optional in order not to break existing super.createDOM(config) calls in subclasses.

Copy link

vercel bot commented Dec 27, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 27, 2023 0:21am
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 27, 2023 0:21am

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 27, 2023
Copy link
Contributor

@acywatson acywatson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea this looks right.

If we fix the integrity problems I can merge.

@acywatson
Copy link
Contributor

Yea this looks right.

If we fix the integrity problems I can merge.

Actually might have been a transient infra failure...retrying.

@thorn0
Copy link
Contributor Author

thorn0 commented Jan 6, 2024

Actually might have been a transient infra failure

it was

@ivailop7 ivailop7 merged commit 4038fd7 into facebook:main Jan 6, 2024
45 checks passed
amanharwara pushed a commit to standardnotes/lexical that referenced this pull request Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants