Skip to content

Commit 7d2d0a2

Browse files
authored
refactor: remove replicas (#358)
## 📜 Description Removed replicas from the package. ## 💡 Motivation and Context Initially when I started to work on this package I thought to add replicas for iOS or Android if I can not derive values from a native code. Turned out I can actually derive them, so replicas are kind of not useful anymore. These methods were not documented anywhere, but I see that people are constantly trying to find these methods in documentation: <img width="577" alt="image" src="https://github.com/kirillzyusko/react-native-keyboard-controller/assets/22820318/1ad9b20a-2d33-40cf-9db3-5e5094826e93"> Since these methods were never a part of official API of this library - I'm removing them 😎 Also this change can be considered as optimization, because I'm removing code and thus reduce size of the package. ## 📢 Changelog <!-- High level overview of important changes --> <!-- For example: fixed status bar manipulation; added new types declarations; --> <!-- If your changes don't affect one of platform/language below - then remove this platform/language --> ### JS - removed `replicas` ## 🤔 How Has This Been Tested? Tested manually on iPhone 15 Pro and Pixel 2. ## 📝 Checklist - [x] CI successfully passed - [x] I added new mocks and corresponding unit-tests if library API was changed
1 parent 490b712 commit 7d2d0a2

16 files changed

Lines changed: 2 additions & 183 deletions

FabricExample/src/components/KeyboardAnimation/index.tsx

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
import React from "react";
22
import { Animated, TextInput, View } from "react-native";
3-
import {
4-
useKeyboardAnimation,
5-
useKeyboardAnimationReplica,
6-
} from "react-native-keyboard-controller";
3+
import { useKeyboardAnimation } from "react-native-keyboard-controller";
74

85
import styles from "./styles";
96

107
export default function KeyboardAnimation() {
118
const { height, progress } = useKeyboardAnimation();
12-
const { height: heightReplica } = useKeyboardAnimationReplica();
139

1410
return (
1511
<View style={styles.container}>
@@ -51,15 +47,6 @@ export default function KeyboardAnimation() {
5147
transform: [{ translateY: height }],
5248
}}
5349
/>
54-
<Animated.View
55-
style={{
56-
width: 50,
57-
height: 50,
58-
backgroundColor: "blue",
59-
borderRadius: 25,
60-
transform: [{ translateY: heightReplica }],
61-
}}
62-
/>
6350
</View>
6451
</View>
6552
</View>
-532 Bytes
Loading
-302 Bytes
Loading
-487 Bytes
Loading
-539 Bytes
Loading
-652 Bytes
Loading
-1.56 KB
Loading
-4.56 KB
Loading
-2.79 KB
Loading
-4.4 KB
Loading

0 commit comments

Comments
 (0)