0.5.5 • Published 2 years ago

@b3w/react-statistic v0.5.5

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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.

0.5.4

2 years ago

0.5.3

2 years ago

0.5.5

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago

0.4.4

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.3.5

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.3

4 years ago

0.2.9

4 years ago

0.2.8

4 years ago

0.2.7

4 years ago