Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/typescript-7-support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@react-spring/core': patch
---

fix(core): support TypeScript 7

The `Controller` constructor's `flush` parameter was typed as `ControllerFlushFn<any>`. TypeScript 7 resolves that to a queue of `unknown`, which rejected valid flush functions, including the one `useSprings` passes internally. It's now typed as `ControllerFlushFn<Controller<any>>`, which behaves the same on every supported TypeScript version.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ts: ['5.7', '5.9', '6.0']
ts: ['5.7', '5.9', '6.0', '7.0']

steps:
- name: Checkout repo
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class Controller<State extends Lookup = Lookup> {

constructor(
props?: ControllerUpdate<State> | null,
flush?: ControllerFlushFn<any>
flush?: ControllerFlushFn<Controller<any>>
) {
this._onFrame = this._onFrame.bind(this)
if (flush) {
Expand Down
Loading