Skip to content

Evaluate specifying React in package.json's peerDependencies instead of failing at runtime #1

@roberto-red

Description

@roberto-red

This package is dependent of React, but its package.json does not mention React anywhere. Instead, the code uses a dynamic CommonJS require() in order to be able to show an error when React is not installed.

This may be solved with package.json's peerDependencies, which also allows us to specify which React version the code is compatible with. Here is an in-depth explanation from the node.js blog:

https://nodejs.org/en/blog/npm/peer-dependencies

I've personally never used it before and there might be some pitfalls, so this change will need to be thoroughtly evaluated first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions