Skip to content

Need peer dep on react-native? #130

Closed
@erikras

Description

How can this line work if there is no mention of react-native in package.json?

import React from 'react-native';

I understand that there is an assumption that if anyone is requireing native.js, that they will already have react-native included in their project deps, but it seems very odd that a library could have an import of a package not mentioned in its package.json.

Am I wrong? I'm trying to understand this mechanism to duplicate it in my own project, and this is confusing me. Could you add a peer dep that didn't cause problems for people just using plain react, or is this just a strangeness of the npm dep system?

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