Skip to content

Add ESM build to react-is #13272

Closed
Closed
@pgarciacamou

Description

@pgarciacamou

Do you want to request a feature or report a bug?

Feature

What is the current behavior?

Unable to import individual modules from the package.

import * as ReactIs from "react-is";
ReactIs.isValidElementType(<div />); // true

What is the expected behavior?

import { isValidElementType } from "react-is";
isValidElementType(<div />); // true

Context

This issue arose when trying to to make react-redux work with React.forwardRef (see this PR), but evidently, react-is doesn't allow import/export ESM to enable tree shaking capabilities in react-redux (that is my understanding).

This issue is following this comment.

I tried solving this (and totally failed) in #13250 before I realised anything about ESM. But this is now over my head, so I'm creating an issue now and see how that follows.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions