2.1.0 • Published 4 years ago

@kazukinagata/react-nps-typescript v2.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

@kazukinagata/react-nps-typescript

Compnent for gathering Net Promoter Score surveys. Created with create-react-library.

NPM JavaScript Style Guide

Install

npm install --save @kazukinagata/react-nps-typescript

or

yarn add @kazukinagata/react-nps-typescript

Usage

import React, { Component } from 'react'

import NPS from '@kazukinagata/react-nps-typescript'
import '@kazukinagata/react-nps-typescript/dist/index.css'

const Example = () => {
  const [score, setScore] = React.useState<number | null>(null)
  const [dismissed, setDismissed] = React.useState(false)

  return (
    <NPS
      score={score}
      dismissed={dismissed}
      onSubmit={(score) => {console.log(`clicked ${score}`); setScore(score)}}
      onDismissed={() => setDismissed(true)}
    />
  )
}

License

MIT © kazukinagata

Thanks

Initially inspired by react-nps-input

2.1.0

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago