Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify example in Next.js A/B tests tutorial #9457

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

senky
Copy link

@senky senky commented Sep 27, 2024

Changes

When reading the tutorial, I got a weird feeling with one of the examples. An effect without dependencies and without async function is probably useless. Then I realized that it is most probably to allow PHProvider to call posthog.init before posthog.getFeatureFlag is called.

I think this reason shouldn't be implicit, and two ways to make it clear are (afaik):

  1. Add a comment explaining the reason.
  2. Use the feature flags component (PostHogFeature from posthog-js/react).

I think you want the tutorial to be as minimal as possible (using the component only adds more cognitive load), therefore I opted for the comment.

Copy link

vercel bot commented Sep 27, 2024

@jaksenko is attempting to deploy a commit to the PostHog Team on Vercel.

A member of the Team first needs to authorize it.

When reading the tutorial, I got a weird feeling with one of the examples. An effect without dependencies and without async function is probably useless. Then I realized that it is most probably to allow `PHProvider` to call `posthog.init` before `posthog.getFeatureFlag` is called.

I think this reason shouldn't be implicit, and two ways to make it clear are (afaik):
1. Add a comment explaining the reason.
2. Use the feature flags component (`PostHogFeature` from `posthog-js/react`).

I think you want the tutorial to be as minimal as possible (using the component only adds more cognitive load), therefore I opted for the comment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant