@@ -21,10 +21,10 @@ import { KeyboardContext } from '../../context';
2121 * ```
2222 */
2323export const KeyboardCompatibleView = ( {
24+ children,
2425 enabled = true ,
2526 keyboardDismissAnimationDuration = 500 ,
2627 keyboardOpenAnimationDuration = 500 ,
27- children,
2828} ) => {
2929 const heightAnim = useRef ( new Animated . Value ( 0 ) ) . current ;
3030 const rootChannelView = useRef ( ) ;
@@ -39,15 +39,15 @@ export const KeyboardCompatibleView = ({
3939
4040 useEffect ( ( ) => {
4141 Animated . timing ( heightAnim , {
42- toValue : channelHeight ,
4342 duration : isKeyboardOpen
4443 ? keyboardDismissAnimationDuration
4544 : keyboardOpenAnimationDuration ,
45+ toValue : channelHeight ,
4646 useNativeDriver : false ,
4747 } ) . start ( ) ;
4848 } , [
49- heightAnim ,
5049 channelHeight ,
50+ heightAnim ,
5151 keyboardDismissAnimationDuration ,
5252 keyboardOpenAnimationDuration ,
5353 ] ) ;
@@ -62,16 +62,16 @@ export const KeyboardCompatibleView = ({
6262 } else {
6363 // Bring the channel height to its full length state.
6464 Animated . timing ( heightAnim , {
65- toValue : initialHeight ,
6665 duration : keyboardDismissAnimationDuration ,
66+ toValue : initialHeight ,
6767 useNativeDriver : false ,
6868 } ) . start ( resolve ) ;
6969 }
7070 } ) ;
7171 } , [
72+ channelHeight ,
7273 heightAnim ,
7374 initialHeight ,
74- channelHeight ,
7575 isKeyboardOpen ,
7676 keyboardDismissAnimationDuration ,
7777 ] ) ;
@@ -90,13 +90,13 @@ export const KeyboardCompatibleView = ({
9090 if ( ! initialHeight ) {
9191 setInitialHeight ( height ) ;
9292 Animated . timing ( heightAnim , {
93- toValue : height ,
9493 duration : 10 ,
94+ toValue : height ,
9595 useNativeDriver : false ,
9696 } ) . start ( ) ;
9797 }
9898 } ,
99- [ heightAnim , initialHeight , enabled ] ,
99+ [ enabled , heightAnim , initialHeight ] ,
100100 ) ;
101101
102102 if ( ! enabled ) {
0 commit comments