react-hooks-giphy
Super easy Giphy API support for ReactJS
Dependencies
Needs axios
as a dependency
npm install --save axios
yarn
yarn add axios
Install
Note: Make sure that you have installed the correct version of
react(>= v16.8.0)
andreact-dom(>= v16.8.0)
.
npm
npm install --save react-hooks-giphy
yarn
yarn add react-hooks-giphy
Demo
Usage
import Giphy
;
Get random gif
<Giphy />
tag
Get gif with a <Giphy tag="happy" />
triggers
to refresh with a new gif
Pass in <Giphy triggers=triggers />
Configuring Options
Show gif title
const config = title: true;<Giphy ...config />;
Example
;;; ; { const flag triggerFlag = ; return <div className="App"> <h1>React Hooks Giphy</h1> <p> Random Gif </p> <Giphy /> <p> Happy Gif </p> <Giphy tag="happy" /> <p> Happy Gif with a trigger to refresh Gif</p> <Giphy tag="happy" triggers=flag /> <button onClick= >Get another gif</button> </div> ;} const rootElement = document;ReactDOM;
Contribution
Make a PR
Development
Node >= v8 LTS
- Clone the project to local disk
npm install
npm start