vtaits / react-select-async-paginate

Wrapper above react-select that supports pagination on menu scroll
MIT License
303 stars 75 forks source link

Peer dependency warnings when installing with React 16.14 #159

Closed apokryfos closed 5 months ago

apokryfos commented 5 months ago

Are you submitting a bug report or a feature request or a question?

Bug report

What is the current behavior?

The following message is shown when trying to install in a React 16 project

npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @vtaits/use-lazy-ref@0.1.0
npm WARN Found: react@16.14.0
npm WARN node_modules/react
npm WARN   react@"^16.14.0" from the root project
npm WARN   35 more (@emotion/react, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"^17.0.0 || ^18.0.0" from @vtaits/use-lazy-ref@0.1.0
npm WARN node_modules/react-select-async-paginate/node_modules/@vtaits/use-lazy-ref
npm WARN   @vtaits/use-lazy-ref@"^0.1.0" from react-select-async-paginate@0.7.3
npm WARN   node_modules/react-select-async-paginate
npm WARN 
npm WARN Conflicting peer dependency: react@18.2.0
npm WARN node_modules/react
npm WARN   peer react@"^17.0.0 || ^18.0.0" from @vtaits/use-lazy-ref@0.1.0
npm WARN   node_modules/react-select-async-paginate/node_modules/@vtaits/use-lazy-ref
npm WARN     @vtaits/use-lazy-ref@"^0.1.0" from react-select-async-paginate@0.7.3
npm WARN     node_modules/react-select-async-paginate

The issue seems to be that @vtaits/use-lazy-ref@0.1.0 has a peer dependency of react 17 || 18 but this library has a peer dependency of 16.14 || 17 || 18

What is the expected behavior?

There should not be any warnings when trying to install on a platform where the peer dependencies of this package are satisfiable

I am not sure if the solution here is to drop the use-lazy-ref dep or just set the minimum peer react dependency to 17 and call it a day

What's your environment?

package.json (part)

    "react": "^16.14.0",
    "react-dom": "^16.14.0",
    "react-select": "^5.8.0",
    "react-select-async-paginate": "^0.7.3",
vtaits commented 5 months ago

Hello. react@^16.14.0 is added to @vtaits/use-lazy-ref. Try to reinstall react-select-async-paginate