tw-in-js / use-twind-with

Twind integration packages for frameworks & libraries with examples
MIT License
68 stars 17 forks source link

React 18 support for twind/next #31

Closed venables closed 2 weeks ago

venables commented 2 years ago

Next.js supports React 18 by default now, but @twind/next is defined to max out at react ^17

I believe the library is compatible with react 18 as-is, so it should be an easy fix -- by modifying the react peerDependency in package.json to include ^18, like so:

-    "react": "^16.6.0 || ^17",
+    "react": "^16.6.0 || ^17 || ^18",
jmayergit commented 1 year ago

I believe the library is compatible with react 18 as-is

This library needs to be updated so it's not so easy

https://nextjs.org/docs/advanced-features/custom-document

To prepare for React 18, we recommend avoiding customizing getInitialProps and renderPage, if possible.

This library customizes getInitialProps and renderPage

https://github.com/vercel/next.js/issues/31225

Prior to React 18, many CSS-in-JS libraries would just return a script tag for you to insert into your Document at the end of the render...

This library does this

https://github.com/reactwg/react-18/discussions/110

Library Upgrade Guide: