Skip to content

Commit 88f4a26

Browse files
committed
fix: view flattening issues when using <Anchor>
1 parent 4df5e1a commit 88f4a26

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

example/src/App.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ const ScrollToButtons = () => {
7171
const styles = StyleSheet.create({
7272
container: {
7373
flex: 1,
74+
marginTop: 200,
7475
alignItems: 'center',
7576
justifyContent: 'center',
7677
},

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sellpy/react-native-scroll-anchor",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Hooks and utilities to simplify scrolling to elements in react native",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

src/components/Anchor.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,9 @@ export const Anchor = ({
1111
children: ReactNode;
1212
}) => {
1313
const ref = useAnchorRef(name);
14-
return <View ref={ref}>{children}</View>;
14+
return (
15+
<View collapsable={false} ref={ref}>
16+
{children}
17+
</View>
18+
);
1519
};

0 commit comments

Comments
 (0)