Skip to content

Instantly share code, notes, and snippets.

@buddyeorl
Last active October 13, 2020 23:00
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 buddyeorl/c78cd9e68a27bad7530dcff818624934 to your computer and use it in GitHub Desktop.
Save buddyeorl/c78cd9e68a27bad7530dcff818624934 to your computer and use it in GitHub Desktop.
import React from 'react';
import CodeGist from '../PathToCodeGist;
//CodeGist props:
//url:string //<-- represents the Github gist url
//CodeGist accept a children component as a prop, so you can wrap a label or any component you want to render before
// the Gist
const Example=()=>{
return(
<React.Fragment>
<CodeGist url={"https://gist.github.com/buddyeorl/c78cd9e68a27bad7530dcff818624934.js"}>
<h1> This is an optional component to be rendered before the code </h1>
</CodeGist>
</React.Fragment>
)}
export default Example;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment