Skip to content

Commit

Permalink
Fix TypeError: 'viewTag' is read-only on Animated.createAnimatedCompo…
Browse files Browse the repository at this point in the history
…nent(FlashList) (#3934)

## Summary

Fixes #3933.

`viewTag` is declared as `const` but for FlashList component we overwrite it afterwards. However, this doesn't trigger an error since there is a `// @ts-ignore` in the previous line.
  • Loading branch information
tomekzaw authored Jan 12, 2023
1 parent 349a1c9 commit 5a88e49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/createAnimatedComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export default function createAnimatedComponent(

_attachNativeEvents() {
const node = this._getEventViewRef();
const viewTag = findNodeHandle(options?.setNativeProps ? this : node);
let viewTag = findNodeHandle(options?.setNativeProps ? this : node);
const componentName = Component.displayName || Component.name;

if (componentName?.endsWith('FlashList') && this._component) {
Expand Down

0 comments on commit 5a88e49

Please sign in to comment.