Skip to content

React context works in export but not on preview #477

Description

@maxaggedon

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions