React Facebook

Components

React components for Facebook SDK integration

Components

React Facebook provides a set of declarative React components for embedding Facebook social plugins and UI elements. Components handle SDK initialization, XFBML parsing, and re-rendering automatically so you can add Facebook features with minimal boilerplate.

All components must be rendered inside a <FacebookProvider>, which initializes the Facebook SDK and provides context to the component tree.

Available Components

ComponentDescription
FacebookProviderInitializes the Facebook SDK and provides context to all child components and hooks
LoginUnified Facebook login component supporting button rendering, render props, and custom elements
LikeRenders a Facebook Like button via the XFBML social plugin
ShareRenders a Facebook Share button via the XFBML social plugin
ShareButtonA customizable button that opens the Facebook Share dialog using the JavaScript SDK
CommentsRenders the Facebook Comments plugin for any URL
CommentsCountDisplays the number of Facebook comments for a given URL
EmbeddedPostEmbeds a public Facebook post on your page
EmbeddedVideoEmbeds a public Facebook video on your page
PageEmbeds a Facebook Page plugin showing timeline, events, and messages
FacebookErrorBoundaryError boundary that catches Facebook SDK errors from ad blockers, network failures, and initialization issues
FacebookPixelProviderStandalone provider for Facebook Pixel tracking without the full Facebook SDK

On this page