Skip to content

Commit

Permalink
fix: usederivedvalue for tabnames value
Browse files Browse the repository at this point in the history
  • Loading branch information
andreialecu committed Feb 7, 2021
1 parent dd85ed4 commit 92f22de
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ const Container = React.forwardRef<CollapsibleRef, CollapsibleProps>(
const accScrollY = useSharedValue(0)
const oldAccScrollY = useSharedValue(0)
const accDiffClamp = useSharedValue(0)
const tabNames = useSharedValue<TabName[]>(tabNamesArray)
const tabNames = useDerivedValue<TabName[]>(() => tabNamesArray, [
tabNamesArray,
])
const index = useSharedValue(
initialTabName ? tabNames.value.findIndex((n) => n === initialTabName) : 0
)
Expand Down

0 comments on commit 92f22de

Please sign in to comment.