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

0.0.3 • Public • Published

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


Agung Yuliyanto
💻

Readme

Keywords

Package Sidebar

Install

npm i react-jixie-hook

Weekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

11.7 kB

Total Files

19

Last publish

Collaborators

  • agung96tm