MCPcopy
hub / github.com/APSL/react-native-keyboard-aware-scroll-view / componentDidMount

Method componentDidMount

lib/KeyboardAwareHOC.js:212–244  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

210 }
211
212 componentDidMount() {
213 this.mountedComponent = true
214 // Keyboard events
215 if (Platform.OS === 'ios') {
216 this.keyboardWillShowEvent = Keyboard.addListener(
217 'keyboardWillShow',
218 this._updateKeyboardSpace
219 )
220 this.keyboardWillHideEvent = Keyboard.addListener(
221 'keyboardWillHide',
222 this._resetKeyboardSpace
223 )
224 } else if (Platform.OS === 'android' && this.props.enableOnAndroid) {
225 this.keyboardWillShowEvent = Keyboard.addListener(
226 'keyboardDidShow',
227 this._updateKeyboardSpace
228 )
229 this.keyboardWillHideEvent = Keyboard.addListener(
230 'keyboardDidHide',
231 this._resetKeyboardSpace
232 )
233 }
234
235 supportedKeyboardEvents.forEach((eventName: string) => {
236 const callbackName = keyboardEventToCallbackName(eventName)
237 if (this.props[callbackName]) {
238 this.callbacks[eventName] = Keyboard.addListener(
239 eventName,
240 this.props[callbackName]
241 )
242 }
243 })
244 }
245
246 componentDidUpdate(prevProps: KeyboardAwareHOCProps) {
247 if (this.props.viewIsInsideTabBar !== prevProps.viewIsInsideTabBar) {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected