@june-so-sandbox/react
v0.3.0
Published
## install
Downloads
3
Readme
@june-so-sandbox/react
install
npm install @june-so-sandbox/react
react usage
import { JuneProvider, useJune } from "@june-so-sandbox/react";
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>
);
};