Skip to content

BUGFIX: Prevent warnings for unrecognized DOM props #3895

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

Open
wants to merge 2 commits into
base: 8.3
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default richtextToolbarRegistry => {
const restProps = omit(props, ['isVisible', 'isActive']);
const isActiveProp = isToolbarItemActive(formattingUnderCursor, inlineEditorOptions)(componentDefinition);

const finalProps = {
let finalProps = {
...restProps,
key: index,
isActive: isActiveProp,
Expand All @@ -41,6 +41,15 @@ export default richtextToolbarRegistry => {
[callbackPropName]: e => e.stopPropagation() || executeCommand(commandName, ...commandArgs)
};

// Filter out properties that are not needed by the component
// and cause render warnings. Specifically for the 'code' command,
// we omit 'executeCommand' and 'formattingUnderCursor' as they
// are custom properties from Neos and not required by CKEditor's
// code plugin.
if (commandName === 'code') {
finalProps = omit(finalProps, ['executeCommand', 'formattingUnderCursor']);
}

const Component = component;

return <Component {...finalProps} />;
Expand Down
Loading