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

VisitorIdentification component now uses sitecore context hook #1041

Conversation

art-alexeyenko
Copy link
Contributor

VisitorIdentification component now uses sitecore context hook instead of withSitecoreContext helper

Description / Motivation

Replacing withSitecoreContext usage in VI component to the context hook - in order to avoid nextjs production issues.

Testing Details

Manual testing

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

…d of withSitecoreContext helper

(cherry picked from commit ee450b6d97e92689150b7fd56c3e1f3c8fd2c243)
@thaiphan
Copy link

Thanks! We were literally running into an issue caused by this.

Copy link
Contributor

@illiakovalenko illiakovalenko left a comment

Choose a reason for hiding this comment

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

In case if it's not working using withSitecoreContext it means that the problem is there? It can be fixed and we don't need to replace HOC by the hook. What is the difference? Why it's working using a hook?

@art-alexeyenko
Copy link
Contributor Author

@illiakovalenko the underlying issue is React context not working with Provider-Consumer approach in production mode (hook is fine) which requires some more work and investigation. Perhaps we can push this proposed change and then take a closer look at the Provider-Consumer problem.

@illiakovalenko illiakovalenko merged commit 58c1993 into Sitecore:dev May 31, 2022
@pzi
Copy link
Contributor

pzi commented Jun 2, 2022

@illiakovalenko @ambrauer are we able to get a hotfix for v20.0.1 with this and the updated types for nextjs pkg, please?

@illiakovalenko
Copy link
Contributor

illiakovalenko commented Jun 2, 2022

@pzi Right, the hotfix will be released, at least for this fix

@pzi
Copy link
Contributor

pzi commented Jun 2, 2022

@illiakovalenko thank you

@art-alexeyenko art-alexeyenko deleted the bug/534621-cannot-read-context-error-with-nextjs-production branch June 29, 2022 21:59
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