rad-ui / ui

Rad UI is an open-source, headless UI component library for building modern, fast, performant, accessible React applications
http://rad-ui.com
MIT License
11 stars 13 forks source link

Fix poor implementations of native html elements extension #169

Closed CCleanerShot closed 7 months ago

CCleanerShot commented 8 months ago

An old way of extending a custom Button to utilize native button elements, was to do use extend the interface with React.ButtonHTMLAttributes<T> and forwardRef(), but React is discontinuing forwardRef() in React 19.

The current implementation is using the React hook, useRef, but being required to pass in a useRef hook has a property is very tedious for a user.

CCleanerShot commented 7 months ago

Upon further research, I think this is the sadly the best solution. Feel free to re-open if you find something. This strangely accounts React saying that they will deprecate it, despite being the only solid way of doing this.

The video that was mentioned in discord that provided an alternative doesn't even work.

kotAPI commented 7 months ago

Thanks for the clarification @CCleanerShot