File tree Expand file tree Collapse file tree 4 files changed +11
-4
lines changed
apps/common-app/src/examples
RuntimeTests/ReJest/TestRunner
packages/react-native-reanimated/src Expand file tree Collapse file tree 4 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ export function createUpdatesContainer() {
112
112
if ( ! ( tag in updatesForTag ) ) {
113
113
updatesForTag [ tag ] = [ ] ;
114
114
}
115
- let update : OperationUpdate = [ ] ;
115
+ let update : OperationUpdate = { } ;
116
116
if ( propsNames . length === 0 ) {
117
117
update = 'update' in updateRequest ? updateRequest . update : updateRequest . snapshot ;
118
118
} else {
Original file line number Diff line number Diff line change @@ -36,13 +36,16 @@ export default function StrictDOMExample() {
36
36
const x = useSharedValue ( 0 ) ;
37
37
const y = useSharedValue ( 0 ) ;
38
38
39
+ // @ts -expect-error There's a TypeScript bug in `react-native-dom` that
40
+ // doesn't allow React-Native-like `transform`, but it works in runtime.
41
+ // https://github.com/facebook/react-strict-dom/issues/204
39
42
const animatedStyle = useAnimatedStyle ( ( ) => {
40
43
return {
41
44
opacity : opacity . value ,
42
45
width : width . value ,
43
46
transform : [ { translateX : x . value } , { translateY : y . value } ] ,
44
47
} ;
45
- } ) ;
48
+ } ) as css . StyleXStyles ;
46
49
47
50
const panGesture = Gesture . Pan ( )
48
51
. onUpdate ( ( e ) => {
@@ -63,6 +66,10 @@ export default function StrictDOMExample() {
63
66
< html . div style = { styles . container } >
64
67
< html . div > React Strict DOM demo</ html . div >
65
68
< GestureDetector gesture = { panGesture } >
69
+ { /* Our property types conversion for Animated Components is conflicting
70
+ with Strict DOM's property type conversions in such a way they generate an endless loop.
71
+ Let's circle back on it in a few years.
72
+ @ts -ignore TODO: */ }
66
73
< animated . html . div style = { [ styles . box , animatedStyle ] } />
67
74
</ GestureDetector >
68
75
</ html . div >
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ const mockTargetValues: LayoutAnimationsValues = {
29
29
30
30
function getCommonProperties (
31
31
layoutStyle : StyleProps ,
32
- componentStyle : StyleProps | Array < StyleProps >
32
+ componentStyle : NestedArray < StyleProps >
33
33
) {
34
34
let componentStyleFlat = Array . isArray ( componentStyle )
35
35
? componentStyle . flat ( )
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ export class PropsFilter implements IPropsFilter {
35
35
if ( key === 'style' ) {
36
36
const styleProp = inputProps . style ;
37
37
const styles = flattenArray < StyleProps > ( styleProp ?? [ ] ) ;
38
- const processedStyle : StyleProps = styles . map ( ( style ) => {
38
+ const processedStyle : StyleProps [ ] = styles . map ( ( style ) => {
39
39
if ( style && style . viewDescriptors ) {
40
40
// this is how we recognize styles returned by useAnimatedStyle
41
41
if ( component . _isFirstRender ) {
You can’t perform that action at this time.
0 commit comments