react-fb-like
Version:
React component for facebook like button
58 lines (45 loc) • 1.74 kB
Markdown
React component for facebook Like and Share button!
[](https://www.zerocho.com/portfolio/ReactFBLike)
```
npm install react-fb-like --save
```
```
var ReactFBLike = require('react-fb-like');
<ReactFBLike language="ko_KR" appId="717589285046812" version="v2.12" />
```
ES2015 style
```
import ReactFBLike from 'react-fb-like';
```
If you go to the another page and come back to where this component locates, sometimes this component disappears.
This is because this component is rendered only once when FB script loads.
So if you want to manually show this component again, you should call `FB.XFBML.parse();`

You can use all props that facebook supports. But be careful! You should use **camelCase**. And attribute **ref** is changed to **reference** because it is a reserved word in React.
[](https://developers.facebook.com/docs/plugins/like-button)
- language(such as en_US, ko_KR, fr_FR) [supported language](https://developers.facebook.com/docs/messenger-platform/messenger-profile/supported-locales)
- appId
- version: version of facebook-jssdk, default: 'v2.12'
- action
- colorscheme
- href
- kidDirectedSite
- layout
- reference(which is a **ref** attribute in facebook)
- share
- showFaces
- width
[](https://zerocho.herokuapp.com/portfolio/ReactFBLike)
Please contribute to this package via **Pull Request**, or you can open **Issues**!
MIT