savvycal-react
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

savvycal-react

React + Hook bindings for the wonderful Savvycal service.

Installation

With npm

npm install --save savvycal-react

With yarn

yarn add savvycal-react

Usage

Wrap your App component with SavvyCalProvider

import React from "react"
import { SavvyCalProvider } from "savvycal-react"
import MyComp from "./components/MyComp"

function App() {
  return (
    <SavvyCalProvider>
      <div className="App">
        <MyComp />
      </div>
    </SavvyCalProvider>
  )
}

export default App

Then in your component:

import { useSavvyCal } from "savvycal-react"

export default function MyComp() {
  const savvyCal = useSavvyCal()

  const handleOpen = () => {
    savvyCal.open({ link: `my/link` })
  }

  return <div>
    <button onClick={handleOpen}>Open SavvyCal</button>
  </div>
}

Credits

Contributors list:

License

Create React App is open source software licensed as MIT. The Create React App logo is licensed under a Creative Commons Attribution 4.0 International license.

Readme

Keywords

Package Sidebar

Install

npm i savvycal-react

Weekly Downloads

4

Version

0.1.2

License

ISC

Unpacked Size

4.27 kB

Total Files

3

Last publish

Collaborators

  • ian_