Skip to content

Commit

Permalink
Add client hint to close provider (#3429)
Browse files Browse the repository at this point in the history
This PR adds a missing client boundary in the close provider file that
was causing crashes when used with Turbopack as reported in the Next.js
repo: vercel/next.js#68205

## Test plan

Thanks to @richardasymmetric [fantastic
repro](vercel/next.js#68205 ) I could check
out the example repo and link a tarball build of the updated
`@headlessui/react` package to validate that this is enough to resolve
the issue. After this change, `next dev` and `next dev --turbo` work in
the same way.
  • Loading branch information
philipp-spiess authored Aug 19, 2024
1 parent 2260422 commit a08be96
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/@headlessui-react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Ensure `Transition` component state doesn't change when it becomes hidden ([#3372](https://github.com/tailwindlabs/headlessui/pull/3372))
- Fix closing components using the `transition` prop, and after scrolling the page ([#3407](https://github.com/tailwindlabs/headlessui/pull/3407))
- Ensure all client components are marked correctly to avoid a crash with React 19 and Turbopack ([#3429](https://github.com/tailwindlabs/headlessui/pull/3429))

## [2.1.2] - 2024-07-05

Expand Down
2 changes: 2 additions & 0 deletions packages/@headlessui-react/src/internal/close-provider.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client'

import React, { createContext, useContext } from 'react'

let CloseContext = createContext(() => {})
Expand Down

0 comments on commit a08be96

Please sign in to comment.