React-native-paper: TextInput ref broken @2.14.0

Created on 20 Mar 2019  路  13Comments  路  Source: callstack/react-native-paper

Environment

RN version: 0.59
RNPaper version: 2.14.0

Description

Assigning a ref to a TextInput in [email protected] returns undefined and accessing .clear(), .focus() crashes the app.

Reproducible Demo

  1. Install RNPaper version 2.14.0
  2. Create a ref in the constructor this.textInputRef = React.createRef()
  3. Assign the ref to a TextInput
  4. Run this.textInputRef.current.clear()
  5. Doesn't work with this.textInputRef.current._root.clear() as well
  • Reverted to 2.13.0 for now and it's working.
bug core team

Most helpful comment

When it comes to ref error, we already know what happened. I'll fix this as soon as possible. Thanks for heads up @kevingalvez-pro

All 13 comments

cc @pbitkowski

I installed "react-native-paper": "^2.14.0", and immediately started getting this error:
Unable to resolve "./components/TextInput" from "node_modules/react-native-paper/src/index.js"

@ablbol This is happening because of Metro bundler. I don't know root issue but for example for this component its moved from single file to folder.I suppose you were using older version and basically packager cannot find this folder. just try this
rm -rf $TMPDIR/react-* && watchman watch-del-all && rm -rf ios/build && rm -rf node_modules/ && npm cache clean --force && npm i
if this command not work you. just restart your computer.

When it comes to ref error, we already know what happened. I'll fix this as soon as possible. Thanks for heads up @kevingalvez-pro

We'll publish minor release with fix for this issue today.

It's fixed in 2.15.0

Hi, I tried using ref and I received the following error:

Attempting to run JS driven animation on animated node that has been moved to "native" earlier by starting an animation with useNativeDriver: true
_animatedPropsCallback
createAnimatedComponent.js:110:10
update
AnimatedProps.js:91:4
_flush
AnimatedValue.js:64:25
_updateValue
AnimatedValue.js:323:13
<unknown>
AnimatedValue.js:290:26
onUpdate
TimingAnimation.js:134:6
_callTimer
JSTimers.js:154:15
callTimers
JSTimers.js:405:17
__callFunction
MessageQueue.js:349:47
<unknown>
MessageQueue.js:106:26
__guard
MessageQueue.js:297:10
callFunctionReturnFlushedQueue
MessageQueue.js:105:17

I'm getting same error in 2.15.0. I've tried to comment ref but it still fails. Probably issue connected to react-native-keyboard-aware-scroll-view

@ablbol Looks like this is connected to Xcode update. Try downgrading to Xcode 10.1.
p.s. not helped for me

I am getting this with 2.15.2: Unable to resolve "./components/TextInput" from "node_modules\react-native-paper\src\index.js"
@satya164 has suggested to clean cache; I did it, deleted node_modules and yarn.lock; still the same error is faced. How to fix this?

@devautor hmm, I asked you to reset metro's cache, not node_modules

Hello @satya164 I did try that afterwards (didn't report for I am getting similar other error). I used exp r -c to clean expo cache, and cleaned cache of expo client too. Now I am getting this:

Unable to resolve "schedule/tracking" from "node_modules\react-native\Libraries\Renderer\oss\ReactNativeRenderer-dev.js"

It has been discussed here, but with expo I don't know how to fix RN. Working on it, still hung!
Thank you!

EDIT: I have my react version misplaced at 16.8.0 it seems. Fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zachariahtimothy picture zachariahtimothy  路  3Comments

sm2017 picture sm2017  路  4Comments

knobandre picture knobandre  路  4Comments

tonyxiao picture tonyxiao  路  3Comments

ButuzGOL picture ButuzGOL  路  4Comments