everweij / react-laag

Hooks to build things like tooltips, dropdown menu's and popovers in React

Home Page:https://www.react-laag.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React 17 support

mtmacdonald opened this issue · comments

Hi! Can we please have support for React 17 so I don't get this peer dependency warning when installing in my React 17 projects? Thanks!

npm WARN react-laag@1.8.0 requires a peer of react@^16.8.0 || ^16.9.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-laag@1.8.0 requires a peer of react-dom@^16.8.0 || ^16.9.0 but none is installed. You must install peer dependencies yourself.

Hi, I guess your best chance would be to make a pull request by yourself. While waiting for the PR to be merge, you can reference your branch as dependency like this :

"dependencies": {
    "react-laag": "https://github.com/mtmacdonald/react-laag.git#{NameOfBranch}", 
}

A question for the maintainers: Do you envisage any major changes required to support React 17 or is it a case of updating the package.json peerDependencies?

I don't think their will be any major changes to this lib. The peerDependencies need to be fix. I'm not working directly with React-laag right now, so if anybody need the update now, I suggest they make a PR about it.

I don't think there will be any changes required. I'm using it in a React 17 project without problems. You can just install and ignore the warning.

Hi all,
Sorry for my late response!
Today I've released version v2.0.0. Hopefully the warning about the incorrect peerDependency should go away from now on.
I've added this to the package.json:

  "peerDependencies": {
    "react": ">=16",
    "react-dom": ">=16"
  }

I've tested against v17 of React the last couple of weeks, so I have faith this will work normally :)

Careful; this will match any future React version, also e.g. React 18 which might not be compatible. A more common way I've seen packages do this is ^16.0.0 || ^17.0.0.

Thanks,
I've updated the package.json. This change will land in the next release.