Created
September 24, 2019 15:17
-
-
Save Shelob9/72e7370f40936bd1a058e6275f4d7368 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
registerBlockType(name, { | |
edit: props => <Editor {...props} />, | |
save: props => <Save {...props} /> | |
}); |
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
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