PostHog / posthog-js-lite

Reimplementation of posthog-js to be as light and modular as possible.
https://posthog.com/docs/libraries
MIT License
69 stars 36 forks source link

posthog-react-native 3.3.9: update documentation, routeToParams is incorrect, routeToProperties is the actual method #300

Closed tyrauber closed 3 weeks ago

tyrauber commented 3 weeks ago

Bug description

I noticed a typescript error when implementing autocapture-configuration. The documentation states:

    navigation: {
       ....
        routeToParams: (name, params) => {
            if (name === "SensitiveScreen") return undefined
            return params
        },
    }

Upon further investigation, that hook, routeToParams wasn't firing. After looking at the source, it looks like the hook name is actually routeToProperties. Changing the name resolves both issues.

A simple fix is updating the documentation.

Related sub-libraries

Additional context

Thank you for your bug report – we love squashing them!

ioannisj commented 3 weeks ago

Hey @tyrauber! Thanx for spotting this. Docs PR is here