-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[WIKI-892] fix: description input component re-render #8600
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
base: preview
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -60,6 +60,10 @@ type Props = { | |||||||||
| * @description Initial value, pass the actual description to initialize the editor | ||||||||||
| */ | ||||||||||
| initialValue: string | undefined; | ||||||||||
| /** | ||||||||||
| * @description Key, to ensure the editor is re-rendered when the key changes | ||||||||||
| */ | ||||||||||
| key: string; | ||||||||||
| /** | ||||||||||
|
Comment on lines
+64
to
67
|
||||||||||
| * @description Key, to ensure the editor is re-rendered when the key changes | |
| */ | |
| key: string; | |
| /** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: makeplane/plane
Length of output: 1831
🏁 Script executed:
# Also get more context by reading the full file structure wc -l apps/web/core/components/editor/rich-text/description-input/root.tsxRepository: makeplane/plane
Length of output: 131
🏁 Script executed:
Repository: makeplane/plane
Length of output: 86
🏁 Script executed:
Repository: makeplane/plane
Length of output: 5743
🏁 Script executed:
Repository: makeplane/plane
Length of output: 5965
🏁 Script executed:
Repository: makeplane/plane
Length of output: 3879
🏁 Script executed:
Repository: makeplane/plane
Length of output: 1374
🌐 Web query:
React key prop special handling component props💡 Result:
In React,
keyis special-cased by React: it’s used internally to identify elements during reconciliation, and it is not forwarded to your component as a normal prop—soprops.keyisundefined. If you need that same value inside the child, pass it again under a different name. [1]Related: historically
refwas also special and not forwarded; starting in React 19,refcan be read as a prop in function components (but not for class components). [1][2]Sources: React “Special Props Warning” docs [1], React 19 announcement (“ref as a prop”) [2].
Remove
keyfrom the Props interface (React reserves it and doesn't pass it to components).keyis a special React attribute handled by the reconciler for element identity and is not passed to component props. The component already demonstrates this by not destructuringkey(lines 102–117) despite including it in the type. Including it in the Props interface is misleading—callers may think they're controlling re-renders through a prop when React's JSXkeyattribute (already used correctly at call sites likekey={issue.id}) is what actually drives reconciliation.🔧 Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents