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

React context works in export but not on preview #477

Open
maxaggedon opened this issue Sep 4, 2023 · 1 comment
Open

React context works in export but not on preview #477

maxaggedon opened this issue Sep 4, 2023 · 1 comment

Comments

@maxaggedon
Copy link
Contributor

Describe the bug
Consuming a react context with useContext(ThemeContext) yields an error :

TypeError: Cannot read properties of null (reading 'useContext')

To Reproduce
Steps to reproduce the behavior:

  1. Create a context file
  2. Use the Provider in your layout
  3. Try to access value in your template
  4. See error when using yarn preview

Expected behavior
Same rendering as in exported templates

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Chrome
  • Version: 1.0.1
@mnikolaus
Copy link

mnikolaus commented Oct 19, 2023

Check these conversations
#276
#426

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

No branches or pull requests

2 participants