Skip to content

Instantly share code, notes, and snippets.

@Shelob9
Created September 24, 2019 15:17
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/72e7370f40936bd1a058e6275f4d7368 to your computer and use it in GitHub Desktop.
Save Shelob9/72e7370f40936bd1a058e6275f4d7368 to your computer and use it in GitHub Desktop.
registerBlockType(name, {
edit: props => <Editor {...props} />,
save: props => <Save {...props} />
});
export const Editor = ({attributes}) => {
const {something} = attributes;
const [data,setData]= useState({});
useEffect( () => {
fetch( `https://hiroy.club/${something}`)
.then(r => r.json())
.then(r => setData(r);
}, [something, setData]);
return (
<div />
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment