0.0.3 • Published 6 months ago

june-so-sandbox-preact v0.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
6 months ago

june-so-sandbox-preact

install

npm install june-so-sandbox-preact

react usage

import { JuneProvider, useJune } from "june-so-sandbox-preact";

const App = ({ children }) => {
  return <JuneProvider writeKey={"%YOUR_WRITE_KEY%"}>{children}</JuneProvider>;
};

const Component = () => {
  const { track } = useJune();

  const onClick = () => {
    track({
      event: "%YOUR_EVENT_NAME%",
      timestamp: new Date(),
    });
  };

  return (
    <div>
      <button onClick={onClick}>click me</button>
    </div>
  );
};
0.0.3

6 months ago

0.0.2

6 months ago