Skip to content

Commit 499eeea

Browse files
committed
Merge branch 'feat/spring-class' of https://github.com/react-spring/react-spring into feat/spring-class
2 parents a221046 + 60041ab commit 499eeea

File tree

5 files changed

+17
-5
lines changed

5 files changed

+17
-5
lines changed

packages/core/src/types/objects.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export type Springify<T> = Lookup<SpringValue<unknown> | undefined> &
4141
/**
4242
* The set of `SpringValue` objects returned by a `useSpring` call (or similar).
4343
*/
44-
export type SpringValues<T extends object = any> = [T] extends [Any]
44+
export type SpringValues<T extends Lookup = any> = [T] extends [Any]
4545
? Lookup<SpringValue<unknown> | undefined> // Special case: "any"
4646
: { [P in keyof T]: SpringWrap<T[P]> }
4747

packages/core/src/types/transition.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export type TransitionHandle<State extends Lookup = UnknownProps> = Merge<
121121

122122
/** The function returned by `useTransition` */
123123
export interface TransitionFn<Item = any, State extends object = any> {
124-
(render: TransitionRenderFn<Item, State>): ReactNode[]
124+
(render: TransitionRenderFn<Item, State>): JSX.Element
125125
}
126126

127127
export interface TransitionRenderFn<Item = any, State extends object = any> {

packages/shared/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
"directory": "dist"
1111
},
1212
"dependencies": {
13+
"@alloc/types": "^1.2.1",
1314
"fluids": "^0.1.6"
1415
},
1516
"devDependencies": {
16-
"@alloc/types": "^1.2.1",
1717
"typescript": "file:../../node_modules/typescript"
1818
}
1919
}

packages/shared/src/FrameLoop.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { FrameRequestCallback } from './types'
22
import * as G from './globals'
33

4+
declare const console: any
45
declare const process:
56
| { env: { [key: string]: string | undefined } }
67
| undefined
@@ -104,7 +105,7 @@ export class FrameLoop {
104105
// To minimize frame skips, the frameloop never stops.
105106
if (lastTime == 0) {
106107
lastTime = G.now()
107-
requestFrame(update)
108+
requestFrame(catchErrors(update))
108109
}
109110
}
110111
}
@@ -183,7 +184,7 @@ export class FrameLoop {
183184
}
184185

185186
lastTime = time
186-
requestFrame(update)
187+
requestFrame(catchErrors(update))
187188
})
188189

189190
this.start = animation => {
@@ -229,3 +230,13 @@ function findIndex<T>(arr: T[], test: (value: T) => boolean) {
229230
const index = arr.findIndex(test)
230231
return index < 0 ? arr.length : index
231232
}
233+
234+
function catchErrors(effect: () => void) {
235+
return () => {
236+
try {
237+
effect()
238+
} catch (e) {
239+
console.error(e)
240+
}
241+
}
242+
}

targets/native/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"react-native": ">=0.58"
1616
},
1717
"devDependencies": {
18+
"@types/react": "~16.9.0",
1819
"@types/react-native": "~0.57.0",
1920
"react-native": "~0.58.0"
2021
},

0 commit comments

Comments
 (0)