unstale

npm / @posthog/react

@posthog/react

What changed in @posthog/react 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-21.

1 breaking2 deprecations8 new APIs and options2 behavior and defaults1 tooling10 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.2 on npm

@posthog/react 124 changes

Breaking changes 1

  • Use the posthog.init option evaluationContexts to specify evaluation contexts such as web, mobile, or checkout.

    1.6.0release notes

Deprecations 2

  • The posthog.init option evaluationEnvironments is deprecated in favor of evaluationContexts; it continues to work and logs a deprecation warning.

    1.6.0release notes

  • The package is deprecated.

    1.5.0release notes

New APIs and options 8

  • React error-boundary fallbacks receive a resetError callback so applications can retry rendering without remounting the boundary.

    1.11.0release notes

  • Accepts an optional defaultValue argument, returned while flags are loading or the flag is absent; supplying it narrows the return type to boolean.

    1.10.0release notes

  • Adds the useFeatureFlagResult hook.

    1.8.0release notes

  • displaySurvey gains an option to disable shown tracking.

    1.7.1release notes

  • Popover surveys support question prefill.

    1.7.0release notes

  • Adds the useThumbSurvey hook.

    1.7.0release notes

  • Feature flags can now be bootstrapped during server-side rendering in ReactJS.

    1.4.0release notes

  • Adds a component that wraps components and captures an event when they are in view in the browser.

    1.3.0release notes

Behavior and default changes 2

  • React component stacks are rendered as linked exception causes so error tracking identifies the crashing component.

    1.10.4release notes

  • useThumbSurvey now tracks when a survey is shown.

    1.7.1release notes

Tooling 1

  • CLI and sourcemap utilities moved to @posthog/plugin-utils to remove cross-spawn from React Native dependencies.

    1.8.3release notes

Fixes and other changes 10

  • Without match, PostHogFeature shows the fallback when the flag evaluates to false.

    1.11.3release notes

  • useThumbSurvey now uses the client passed to PostHogProvider instead of capturing no survey events.

    1.11.2release notes

  • The error boundary still reports the original error when a browser extension makes Error.prototype.name non-writable.

    1.11.1release notes

  • Clarifies that false is a conclusive off evaluation and undefined means no evaluation is available; remote evaluation omits globally inactive flags, while backend local evaluation can resolve cached inactive definitions to false.

    1.10.6release notes

  • Type declarations use ReactElement<any, any> instead of importing JSX, allowing typechecking with @types/react back to the declared 16.8.0 floor.

    1.10.5release notes

  • Disabled bootstrap feature flags are filtered from useActiveFeatureFlags.

    1.10.3release notes

  • PostHogProvider no longer throws or initializes when no API key or client is provided.

    1.9.1release notes

  • Local flag evaluation cache preserves $set_once semantics.

    1.9.0release notes

  • Fixes PostHogFeature to properly handle undefined flags and false values.

    1.8.1release notes

  • Feature flag hooks now check whether the client is initialized, preventing client is undefined errors.

    1.5.1release notes