Skip to content
This repository was archived by the owner on Feb 14, 2023. It is now read-only.
This repository was archived by the owner on Feb 14, 2023. It is now read-only.

Set peerDependencies to "@types/react": "^16.8.0 | ^17.0.2" #216

Open

Description

@RyanNerd

To reduce bloat I try to have all my imports use reactn. For example: import React, {useEffect, useState} from 'reactn';
However, with some more esoteric imports I am forced to import from React: import {InputHTMLAttributes} from 'react';

Bumping the @types/react to the latest version may also resolve this issue #98

Also, since I am using the latest React version when I do an NPM install I have to use the --force switch. Here's the NPM Error vomit:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: rxchart@0.10.15
npm ERR! Found: @types/react@17.0.37
npm ERR! node_modules/@types/react
npm ERR!   @types/react@"^17.0.37" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @types/react@"^16.8.0" from reactn@2.2.7
npm ERR! node_modules/reactn
npm ERR!   reactn@"^2.2.7" from the root project

Activity

  1. quisido commented on Dec 4, 2021

    @quisido
    Collaborator

    A good solution may be to move @types/react to a peer dependency that supports either 16.x or 17.x, as bumping it to 17.x could be a breaking change for users still using 16.

  2. RyanNerd commented on Dec 4, 2021

    @RyanNerd
    Author

    A good solution may be to move @types/react to a peer dependency that supports either 16.x or 17.x, as bumping it to 17.x could be a breaking change for users still using 16.

    Perhaps this change?

      "peerDependencies": {
        "@types/react": "^16.8.0 | ^17.0.2"
      }
    

    I moved my TypeScript defs to DevDependencies which solved the bloat issue.

  3. changed the title [-]To reduce React bloat bump @types/react version from '^16.8.0' to '^17.0.37'[/-] [+]Set `peerDependencies` to `"@types/react": "^16.8.0 | 17.0.2"`[/+] on Dec 4, 2021
  4. changed the title [-]Set `peerDependencies` to `"@types/react": "^16.8.0 | 17.0.2"`[/-] [+]Set `peerDependencies` to `"@types/react": "^16.8.0 | ^17.0.2"`[/+] on Dec 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions