-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Try: Preact #2734
Try: Preact #2734
Changes from all commits
a9b4e07
f45e4ba
b699cf5
3379e61
acf0b64
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 |
---|---|---|
|
@@ -82,7 +82,7 @@ registerBlockType( 'core/audio', { | |
}; | ||
const controls = ( | ||
focus && ( | ||
<BlockControls key="controls"> | ||
<BlockControls> | ||
<BlockAlignmentToolbar | ||
value={ align } | ||
onChange={ updateAlignment } | ||
|
@@ -106,7 +106,7 @@ registerBlockType( 'core/audio', { | |
); | ||
|
||
if ( editing ) { | ||
return [ | ||
return ( | ||
<Placeholder | ||
key="placeholder" | ||
icon="media-audio" | ||
|
@@ -133,17 +133,17 @@ registerBlockType( 'core/audio', { | |
> | ||
{ __( 'Insert from Media Library' ) } | ||
</MediaUploadButton> | ||
</Placeholder>, | ||
]; | ||
</Placeholder> | ||
); | ||
} | ||
|
||
/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */ | ||
return [ | ||
controls, | ||
<div key="audio"> | ||
return ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While it means we can't treat |
||
<div> | ||
{ controls } | ||
<audio controls="controls" src={ src } /> | ||
</div>, | ||
]; | ||
</div> | ||
); | ||
/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */ | ||
} | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -159,18 +159,18 @@ export default class OldEditor extends Component { | |
render() { | ||
const { id } = this.props; | ||
|
||
return [ | ||
<div | ||
key="toolbar" | ||
id={ id + '-toolbar' } | ||
ref={ ref => this.ref = ref } | ||
className="freeform-toolbar" | ||
/>, | ||
<div | ||
key="editor" | ||
id={ id } | ||
className="blocks-editable__tinymce" | ||
/>, | ||
]; | ||
return ( | ||
<div> | ||
<div | ||
id={ id + '-toolbar' } | ||
ref={ ref => this.ref = ref } | ||
className="freeform-toolbar" | ||
/>, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comma here will be output as a string. |
||
<div | ||
id={ id } | ||
className="blocks-editable__tinymce" | ||
/> | ||
</div> | ||
); | ||
} | ||
} |
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.
Can we avoid the
Children
utility and instead leverage the fact thatchildren
is an array in Preact, i.e.I think it would be good if we avoid
Children
altogether.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.
That's the exact same thing, the inner implementation is the same, but I can see that this enables to drop
preact-compat
at some moment.