Skip to content

Commit

Permalink
fix: view flattening issues when using <Anchor>
Browse files Browse the repository at this point in the history
  • Loading branch information
ThunbergOlle committed Apr 24, 2024
1 parent 4df5e1a commit 88f4a26
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const ScrollToButtons = () => {
const styles = StyleSheet.create({
container: {
flex: 1,
marginTop: 200,
alignItems: 'center',
justifyContent: 'center',
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sellpy/react-native-scroll-anchor",
"version": "0.1.0",
"version": "0.1.1",
"description": "Hooks and utilities to simplify scrolling to elements in react native",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down
6 changes: 5 additions & 1 deletion src/components/Anchor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@ export const Anchor = ({
children: ReactNode;
}) => {
const ref = useAnchorRef(name);
return <View ref={ref}>{children}</View>;
return (
<View collapsable={false} ref={ref}>
{children}
</View>
);
};

0 comments on commit 88f4a26

Please sign in to comment.