@b3w/react-statistic
TypeScript icon, indicating that this package has built-in type declarations

0.5.5 • Public • Published

b3w React statistic sender

Install

$ yarn add @b3w/react-statistic

Examples

Use as component

import { Statistic } from '@b3w/react-statistic';

// inside your component return

const App = () => (
        <BrowserRouter>
            <Statistic
                path="/referer/statistic"
                headers={{ someHeader: true }}
            />
            <Routes />
        </BrowserRouter>
    );

Use as hook

import { useStatistic } from '@b3w/react-statistic';

const Component = () => {
    useStatistic({
        path: '/referer/statistic',
        headers: {
            someHeader: true
        }
    });

    return <div>Text</div>;
};

export default Component;

Use as HOC

import { withStatistic } from '@b3w/react-statistic';

const Component = () => {
    return <div>Text</div>;
};

const params = {
    path: '/referer/statistic',
    headers: {
        someHeader: true
    }
};

export default withStatistic(Component, params);

Headers param is optional.

Readme

Keywords

Package Sidebar

Install

npm i @b3w/react-statistic

Weekly Downloads

1

Version

0.5.5

License

ISC

Unpacked Size

8.56 kB

Total Files

18

Last publish

Collaborators

  • rousiq
  • immo.frontend
  • gostev.front