Hi,
I'm getting this error with the latest version of reanimated and react-native.
Argument of type 'AnimatedNode<number>' is not assignable to parameter of type '() => AnimatedNode<number>'.
Any idea how I can prevent/fix this error?
const { time, clock, progress } = useMemoOne(() => ({
clock: new Clock(),
time: new Value(0),
progress: new Value(0),
}), []);
useCode(
block([
cond(not(clockRunning(clock)), [
startClock(clock),
set(time, clock),
]),
set(progress, interpolate(clock, {
inputRange: [time, add(time, duration)],
outputRange: [0, 1],
extrapolate: Extrapolate.CLAMP,
})),
cond(eq(progress, 1), stopClock(clock)),
]),
[],
);

My tsconfig is;
{
"compilerOptions": {
"lib": ["es2017"],
"target": "esnext",
"jsx": "react-native",
"moduleResolution": "node",
"baseUrl": "./",
"allowJs": true,
"allowSyntheticDefaultImports": true,
"isolatedModules": true,
"strict": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"noEmit": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"paths": {
...
},
"typeRoots": ["node_modules/@types"],
},
"exclude": ["node_modules", "**/*.json", "**/*.spec.ts"]
}
The same error get's triggered because of useCode in libraries like react-native-redash in the folder src/Animations
Hello,
Is it because now useCode takes a callback as parameter? useCode(() => block()) Redash only works with 1.2.0 for now.
Now I read to error again this makes sense, but couldn't figure it out back then.. Thanks for pointing this out.
Most helpful comment
Hello,
Is it because now useCode takes a callback as parameter?
useCode(() => block())Redash only works with 1.2.0 for now.