Skip to content

Conversation

@zbeyens
Copy link
Member

@zbeyens zbeyens commented Aug 5, 2025

Summary

Fixes an issue where default elements were causing React hooks errors by removing inject.nodeProps functionality.

Changes

  • Added disableInjectNodeProps parameter to getRenderNodeProps function
  • Disabled inject.nodeProps for default elements in pipeRenderElement to prevent hooks from being called inconsistently
  • Removed unnecessary key prop from ElementContent component

Test plan

This change prevents the error: "Rendered more hooks than during the previous render" that could occur when using transformProps with hooks in default elements.

🤖 Generated with Claude Code

@codesandbox
Copy link

codesandbox bot commented Aug 5, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@changeset-bot
Copy link

changeset-bot bot commented Aug 5, 2025

🦋 Changeset detected

Latest commit: 4757dce

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@platejs/core Patch
platejs Patch
@platejs/utils Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Aug 5, 2025
@zbeyens zbeyens merged commit ea022d6 into main Aug 5, 2025
2 checks passed
@zbeyens zbeyens deleted the fix/type-hooks branch August 5, 2025 16:00
@dosubot dosubot bot added bug Something isn't working core labels Aug 5, 2025
@vercel
Copy link

vercel bot commented Aug 5, 2025

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

Name Status Preview Comments Updated (UTC)
plate 🔄 Building (Inspect) Visit Preview 💬 Add feedback Aug 5, 2025 4:06pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants