tremorlabs / tremor

React components to build charts and dashboards
https://npm.tremor.so
Apache License 2.0
16.21k stars 467 forks source link

[Feature]: React 19 support #1072

Open eps1lon opened 5 months ago

eps1lon commented 5 months ago

What problem does this feature solve?

React 19 is already past its Alpha phase. During Alpha, libraries are encourage to start working on React 19 compatibility. This helps us flush out potential bugs before app developers start adopting React 19.

What does the proposed API look like?

At a glance, recharts and @headlessui/react are the libraries that are incompatible that stand out.

recharts@2.13.0-alpha.3 should fix most of the compat issues (already tracked in https://github.com/tremorlabs/tremor/issues/1054).

@headlessui/react had this compat issue: https://github.com/tailwindlabs/headlessui/issues/3167. https://github.com/tailwindlabs/headlessui/issues/3167 is already fixed on main. However, @tremor/react still uses 1.x so you'd need to bump @headlessui/react to 2.x first to have a chance of getting the fix for @headlessui/react.

LUPLUV commented 4 months ago

Will this be implemented soon? We would love to upgrade to react 19 while using tremor components :)

michaelhays commented 4 weeks ago

Upgrading package.json to recharts@2.13.0 should fix this: https://github.com/recharts/recharts/issues/4558

rminami commented 3 weeks ago

Currently getting this from @headlessui/react when trying to use Tremor with React v19.

./node_modules/@tremor/react/node_modules/@headlessui/react/dist/utils/stable-collection.js
Attempted import error: '__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' is not exported from 'react' (imported as 'r').

Import trace for requested module:
./node_modules/@tremor/react/node_modules/@headlessui/react/dist/utils/stable-collection.js
./node_modules/@tremor/react/node_modules/@headlessui/react/dist/components/tabs/tabs.js
__barrel_optimize__?names=Tab!=!./node_modules/@tremor/react/node_modules/@headlessui/react/dist/headlessui.esm.js
./node_modules/@tremor/react/dist/components/input-elements/Tabs/TabGroup.js
__barrel_optimize__?names=Tab,TabGroup,TabList!=!./node_modules/@tremor/react/dist/index.js
AaronMBMorse commented 1 day ago

@rminami you can force the @headlessui/react to version 2.20 using resolutions in your package.json file. This isn't a great solution for a production application but might work as a holdover until it's updated.