Skip to content

Compatibility with preact #588

Closed
Closed
@piotr-cz

Description

@piotr-cz

React version (preact 10.5.12)

Concurrent mode no

Rest Hooks version (e.g., 5.0.6)

Describe the bug (This is rather a feature request but IMO it's more appropriate to use bug template)
This package seems to not work with Preact (alternative to React with compatible API).

Problem comes up when wrapping an application with <CacheProvider>.
Engine stops rendering any children and what's unfortunate doesn't show any errors.

Small hint is that ot does render when I remove context providers and keep just {children} in
https://github.com/coinbase/rest-hooks/blob/e1e353dfc64725c79ab99bb6a0c85114399c6dfc/packages/core/src/react-integration/provider/CacheProvider.tsx#L56-L64

To Reproduce
Steps to reproduce the behavior:

  1. Create new codesandbox with Preact template
  2. Add @rest-hooks/rest & rest-hooks to dependencies
  3. Add import { CacheProvider } from 'rest-hooks'; to src/index.js
  4. Wrap App by CacheProvider
  5. Problem: Rendered output disappears

Or check codesandbox example

Expected behavior
Package works with Preact just as it would with React

Additional context
No console errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions