From 2a3dadeae89d92d6594c263d693686d23fc69758 Mon Sep 17 00:00:00 2001 From: Melody Denby Date: Tue, 24 May 2022 14:57:42 -0400 Subject: [PATCH] ComponentWillMount is now deprecated and is considered unsafe. The work around simply is to declare anything in ComponentWillMount on its own in the open like here --- src/DoneBar.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/DoneBar.js b/src/DoneBar.js index 1aaf5a1..0329cdc 100644 --- a/src/DoneBar.js +++ b/src/DoneBar.js @@ -35,8 +35,7 @@ class DoneBar extends React.Component { bottom: -81 } - componentWillMount(props) { - const config = { + config = { duration: 250, update: { duration: 250, @@ -44,7 +43,7 @@ class DoneBar extends React.Component { } }; - this.keyboardWillChangeFrameListener = Keyboard.addListener('keyboardWillChangeFrame', ({ endCoordinates }) => { + keyboardWillChangeFrameListener = Keyboard.addListener('keyboardWillChangeFrame', ({ endCoordinates }) => { let { screenY } = endCoordinates; if (screenY === height || this.props.keyboardType !== 'numeric') { @@ -59,7 +58,6 @@ class DoneBar extends React.Component { width: endCoordinates.width }); }); - } render() { if (Platform.OS !== 'ios') {