July 4, 2024
Improved compatibility with React Server Components
The React examples in Tailwind UI are now easier to use with React Server Components (RSC).
Server components don't support passing functions as props, so anywhere we did that in Tailwind UI you'd need to make the parent a client component, even when that component had no actual interactivity.
Using the new data-* state attributes in Headless UI v2.0, we were able to remove all of the render props that we were using to conditionally apply different classes based on the state of the component.
We've also updated any components that
do need to be client components to include 'use client' at the top of the example, so you can copy and paste them into your RSC project and they'll work right away.