tabler / tabler-icons

A set of over 5500 free MIT-licensed high-quality SVG icons for you to use in your web projects.
https://tabler.io/icons
MIT License
17.91k stars 892 forks source link

React 18 Support #241

Closed fl0wx closed 2 years ago

fl0wx commented 2 years ago

Hey all,

is there currently a plan for supporting React18?

Thanks and regards fl0wx

whaaaley commented 2 years ago

Same here. Or at least a way to install without the react dependency... I don't use the react components but I use react in my project.

ilomon10 commented 2 years ago

Any updates?

Kangarused commented 2 years ago

I've tested by forcefully installing @tabler/icons into a React18 project using npm install --force and everything worked fine.

Presumably this would be resolved by updating the peerDependencies specification in the package.json to include 18.x

Kangarused commented 2 years ago

Also for anyone wanting a hacky solution, you can include a .npmrc file in your project with the legacy-peer-deps=true setting, it will cause all your npm installations to ignore peer dependencies.

I'll stress that this is a hacky solution, peer dependencies are often listed for a valid reason - using this hack means you will no longer receive peer dependency warnings/errors for any packages you install

ilomon10 commented 2 years ago

I think its not a problem when you install with npm 14

Disorrder commented 2 years ago

it crashes Next.js app also 😒

Update for Next.js project: just use yarn I tried to fork this repo and fix peerDependencies with no luck. Yarn works perfect

ShahriarKh commented 2 years ago

Kinda disappointing when I saw the error and +1 for this issue. However, I switched to the Webfont version:
Just add

<link rel="stylesheet" href="https://unpkg.com/@tabler/icons@latest/iconfont/tabler-icons.min.css">

and you're good to go.

max-crcl commented 2 years ago

Please, just add

"peerDependencies": {
    "react": "^16.x || 17.x || 18.x",
    "react-dom": "^16.x || 17.x || 18.x"
  },

to package.json.

It already works when disabling the npm protections (--force), so I assume no problems. It would help alot, thanks!

fl0wx commented 2 years ago

@codecalm , thanks :)