npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-kakao-share

v0.4.6

Published

내가 작성한 게시글 또는 피드를 카카오톡에 공유하기 기능

Downloads

344

Readme

Install

npm install react-kakao-share
# or
yarn add react-kakao-share

Install Step

카카오톡 공유하기의 KEY 발급받기

  1. https://developers.kakao.com/ 접속
  2. 내 애플리케이션 메뉴 클릭
  3. 내 애플리케이션 선택 or 애플리케이션 추가
  4. 앱키 에서 JavaScript 키 기억하기

Simple Usage

전역에서 카카오 SDK 불러오기

전역 레이아웃에 카카오 SDK인 useKakaoScript를 적용합니다.
  • 예시)
    • react.js > Index.js or Index.ts
    • next.js > _app.js or _app.ts
import React from "react";
import { useKakaoScript } from "react-kakao-share";

export default function Index() {
  useKakaoScript();

  return <>....</>;
}

카카오톡 공유하기

현재 페이지(URL)를 공유하기 위해서는 kakaoClipboard를 가져와 제목,내용,공유 이미지,key 전달이 필요합니다.

ClipData의 내용은 반드시 입력이 필요합니다

import { kakaoClipboard } from "react-kakao-share";

function App() {
  const clipData = {
    title: "제목",
    description: "내용",
    image: "example_image.png",
    APIKEY: KAKAO_JAVASCRIPT_KEY,
  };

  return (
    <button type="button" onClick={() => kakaoClipboard(clipData)}>
      현재 페이지 공유하기
    </button>
  );
}

카카오톡 공유하기 > 심볼 타입 (아이콘)

카카오톡 아이콘을 클릭하여 현재페이지를 공유합니다.
단, 아이콘 타입의 카카오톡 공유하기 버튼을 사용할 시 카카오 SDK인 useKakaoScript를 전역 레이아웃에 설정할 필요없습니다.
import { KakaoShareButton, kakaoClipboard } from "react-kakao-share";

function App() {
  const clipData = {
    title: "제목",
    description: "내용",
    image: "example_image.png",
    APIKEY: KAKAO_JAVASCRIPT_KEY,
  };

  return (
    // size를 사용하여 아이콘의 크기를 수정할 수 있습니다.
    <KakaoShareButton size="36px" onClick={() => kakaoClipboard(clipData)} />
  );
}