Skip to content

agung96tm/react-jixie-hook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
💻

About

This package is a library for integrate jixie analytics in your react project

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors