Skip to content

Support React 17 compatibility in @openuidev/react-lang #690

Description

@Neper98

Hi team, thanks for building @openuidev/react-lang.
We would like to use @openuidev/react-lang in some existing business applications that are still running React 17. However, version 0.2.6 currently declares:

and the runtime imports React 18-only APIs such as:

useSyncExternalStore
useInsertionEffect

These APIs are not available in React 17, so the package cannot be safely used in React 17 applications.
Would you consider adding React 17 compatibility, possibly by using compatibility shims/fallbacks?
Potential approach:

// useSyncExternalStore
import { useSyncExternalStore } from "use-sync-external-store/shim";

// useInsertionEffect fallback
const useSafeInsertionEffect =
  React.useInsertionEffect ?? React.useLayoutEffect ?? React.useEffect;

If compatibility is added, the peer dependency could potentially be relaxed to something like:

"react": "^17.0.2 || ^18.3.1 || ^19.0.0"

Use case: many enterprise/business systems are still on React 17, and supporting it would make @openuidev/react-lang easier to adopt without requiring a full React upgrade first.
Thanks!

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