0.0.3 • Published 3 years ago

react-jixie-hook v0.0.3

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

React Jixie Hook

Build Status

This package is a library for integrate jixie analytics in your react project and inspired by react-gtm-hook.

Getting Started

In your React project run

npm i --save react-jixie-hook

How to use

import { JixieProvider, useJixieDispatch } from 'react-jixie-hook';

const App = () => {
  const jixieParams = {
    id: 'jixie-123',
  }

  return (
    <JixieProvider state={jixieParams}>
      <div>
        <LoginView />
      </div>
    </JixieProvider>
  )
}

const LoginView = () => {
  const sendDataToJixie = useJixieDispatch()
  const handleClick = () => sendDataToJixie({ event: 'login', value: 'imAwesome' });

  return (
    <div>
      <h1>Login</h1>
      <button onClick={handleClick}>Login</button>
    </div>
  )
}

Contributors

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago