Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

lesca-facebook-share

jameshsu11259MIT1.1.3TypeScript support: included

Simple facebook share

lesca, Facebook share

readme

React React React React React NPM React NPM

Why use it?

It use for share url to Facebook simply.

Live Demo

Installation

npm install lesca-facebook-share --save

Usage

install before DOM Render

import Facebook from 'lesca-facebook-share';

Facebook.install('facebook-app-id'); // get your id => https://developers.facebook.com/apps/

share with parameters

Facebook.share({
  href: 'https://github.com/jameshsu1125/lesca-facebook-share',
  quote: 'use share facebook api simply',
  hashtag: 'lesca_facebook_share',
  redirect_uri: window.location.href,
});

Development

Methods

method description return
.install(uid: string) initialize with uid void
.share({ href: string, hashtag: string, quote: string, redirect_url: string}) parmaters

share parmaters

parmaters description default
href: string share url
hashtag: string hashtag void
quote: string quote void
redirect_url: string redirect url (mobile necessary) location.href

Features

  • maintain if necessary