useSocialShare
A custom hook for generating social media share URLs. This hook formats the shared URL based on the specified social media platform and supported parameters.
Usage
import { useSocialShare } from 'social-hooks';
const Demo = () => {
const { twitter } = useSocialShare({
url: 'https://google.com',
});
return (
<div>
Shareable twitter url: {twitter}.
{/* https://twitter.com/intent/tweet?url=https%3A%2F%2Fgoogle.com */}
</div>
);
};Reference
Prop
Description
Supports
Last updated