Skip to content

Conversation

@hamzanasir
Copy link

No description provided.

@hamzanasir hamzanasir requested a review from a team as a code owner October 25, 2025 16:58
@changeset-bot
Copy link

changeset-bot bot commented Oct 25, 2025

⚠️ No Changeset found

Latest commit: 8d78f33

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

type: INSTANCE_DISPATCH_ACTION.RESET_STATE,
value: INSTANCE_LOADING_STATE.SDK_LOADED,
});
// eslint-disable-next-line react-hooks/exhaustive-deps
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should turn what's missing here into refs rather than ignore the deps array.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would that mean keeping the sdkInstance in a ref AND in state? Would that open us up to issues if the instances aren't the same/managed?

type: INSTANCE_DISPATCH_ACTION.SET_LOADING_STATUS,
value: INSTANCE_LOADING_STATE.SDK_LOADED,
});
} catch (error) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This setup looks good 👍

}, [memoizedScriptOptions]); // Only reset when script options change

// SDK loading effect - only runs on client (useEffect doesn't run during SSR)
useEffect(() => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this useEffect might conflict with the useEffect on line 99. Also, having this dispatch separate from the createInstance call feels incorrect, as in, I think we should have this dispatch occur in the same effect as the create call.

@EvanReinstein
Copy link
Contributor

Closing this PR in favor of the changes here which include some of the updates that have been demonstrated here.

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.

4 participants