Created
January 18, 2018 16:08
-
-
Save royboy789/a0cab8e6a4807f8a11cfd0df61c80b6d to your computer and use it in GitHub Desktop.
ES5 vs ES6 edit callback
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // the edit callback for wp.blocks.registerBlockTypes() | |
| /** | |
| * ES5 | |
| * | |
| */ | |
| edit: function( props ) { | |
| var attributes = props.attributes, | |
| setAttributes = props.setAttributes, | |
| className = props.className, | |
| id = props.id; | |
| return element( 'div', { className: classname }, __( 'Who', 'ex2-plainjs' ) + ': ' + attributes.who ) | |
| } | |
| /** | |
| * ES6 | |
| * | |
| */ | |
| edit: function({attributes, setAttributes, className, focus, id}) { | |
| return element( 'div', { className: classname }, __( 'Who', 'ex2-plainjs' ) + ': ' + attributes.who ) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment