useSocial

Comprehensive hook combining all social operations (posts, likes, follows, friends) into a single interface

🔧

Live preview would be rendered here

Component: useSocial

Install component

npm
$npm install bigblocks
import { useSocial } from 'bigblocks';

function SocialDashboard() {
  const {
    createPost,
    likePost,
    followUser,
    friends,
    isLoading,
    error
  } = useSocial();

  const handlePost = () => {
    createPost({
      content: "Hello Bitcoin world!",
      contentType: 'text/plain'
    });
  };

  return (
    <div>
      <button 
        onClick={handlePost} 
        disabled={isLoading}
      >
        Create Post
      </button>
      
      {error && <div>Error: {error.message}</div>}
      
      <div>Friends: {friends.length}</div>
    </div>
  );
}