Created
March 6, 2019 18:30
-
-
Save Shelob9/142452f88d075943b319b4f3f8a7165f to your computer and use it in GitHub Desktop.
This file contains 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
const Display = (props) => ( | |
<div>{props.whatever}</div> | |
); | |
registerBlockType( | |
"hi/roy", | |
{ | |
//... | |
edit({ attributes, setAttributes }) { | |
return ( | |
<Fragment> | |
<InspectorControl> | |
<TextControl value={attributes.whatever} onChange={(whatever) => setAttributes({whatever})} /> | |
</InspectorControl> | |
<Display {...attributes} /> | |
</Fragment> | |
); | |
}, | |
save({ attributes }) { | |
<Display {...attributes} /> | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment