1.0.29 • Published 4 months ago
react-embed-gist v1.0.29
React Embed Gist
Simple react component which can embed gist in your React application
How to use
Just import as dependency in your file and pass gist as parameter, for example:
import ReactEmbedGist from 'react-embed-gist';
// Only required attribute is gist
<ReactEmbedGist
gist="msaracevic/5d757e2fc72482a9a4a439969500c2eb"
wrapperClass="gist__bash"
loadingClass="loading__screen"
titleClass="gist__title"
errorClass="gist__error"
contentClass="gist__content"
file=".bash_profile.sh"
LoadingFallback={<Loading />}
/>
Attributes
gist
- gist you want to display, in a form of :USERNAME/:GIST_IDfile
- optional, if you want to show just a single file from the gist, you can specify it herewrapperClass
- optional, if you want to pass your own class toarticle
wrapping the gisttitleClass
- optional, if you want to pass your own class toh2
title of the gistcontentClass
- optional, if you want to pass your own class tosection
wrapping the contenterrorClass
- optional, if you want to pass your own class toarticle
wrapping the error messageloadingClass
- optional, if you want to pass your own class toarticle
wrapper which is displayed during loading timeLoadingFallback
- optional, if you want to pass custom loading component which is displayed during loading time
Breaking changes
- Before version
1.0.24
usedloadingFallback
as prop name for React node to render while waiting for download. After and including version1.0.24
should useLoadingFallback
Changelog
1.0.29
- Set LoadingFallback as state to allownext.js
to actually work for a change...1.0.28
- Add this changelog1.0.27
- Update typescript definitions1.0.26
- Update to React v19, rewrite 7 years old code withuseState
instead of old lifecycle methods1.0.25
- We pretend this doesn't exist1.0.24
- We pretend this doesn't exist1.0.22 - 1.0.23
- Update dependencies1.0.21
- Remove UUID from state1.0.14
- Build as UMD module1.0.12 - 1.0.20
- Update dependencies1.0.11
- Add loading fallback component1.0.10
- Add error messages1.0.09
- Reload the component if gist prop changes dynamically1.0.0 - 1.0.08
- Over 5 years ago, don't remember :)
1.0.26
4 months ago
1.0.25
4 months ago
1.0.24
4 months ago
1.0.29
4 months ago
1.0.28
4 months ago
1.0.27
4 months ago
1.0.23
8 months ago
1.0.22
1 year ago
1.0.21
1 year ago
1.0.20
1 year ago
1.0.19
1 year ago
1.0.18
1 year ago
1.0.17
2 years ago
1.0.16
2 years ago
1.0.15
3 years ago
1.0.14
3 years ago
1.0.13
3 years ago
1.0.12
4 years ago
1.0.11
5 years ago
1.0.10
6 years ago
1.0.9
6 years ago
1.0.8
6 years ago
1.0.7
7 years ago
1.0.6
7 years ago
1.0.5
7 years ago
1.0.4
7 years ago
1.0.3
7 years ago
1.0.2
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago