Skip to content

Instantly share code, notes, and snippets.

@Shelob9
Created March 6, 2019 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shelob9/142452f88d075943b319b4f3f8a7165f to your computer and use it in GitHub Desktop.
Save Shelob9/142452f88d075943b319b4f3f8a7165f to your computer and use it in GitHub Desktop.
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