Unable to login my app via instagram. I am using react-native instagram package, but i am facing the issue as _react3.default.creteRef() is not a function. Refer the attachment
Environment:
Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: ^0.53.3 => 0.53.3
Xcode: Xcode 10.1 Build version 10B61
npm: 5.6.0
OS: macOS 10.14.2
Node: 9.4.0
Starting from React 16.3, the React API included a createRef() method that can be used for creating refs in much the same way as we did using the callback function. You simply create a ref by calling React. createRef() and assign the resulting ref to an element.
createRef() is a new API that shipped with React 16.3. You can create a ref by calling React. createRef() and attaching a React element to it using the ref attribute on the element. class Example extends React. Component { constructor(props) { super(props) // Create the ref this.
You are using an old version of react. The createRef API was added in React 16.3.0 and you are using 16.2.0. Release notes here
It seems that this new API is being called from one of your dependencies, as the stacktrace mentions Instagram.js, you need to either update React, or change or downgrade that dependency.
try changing,
ref='ins'
to
ref={instance=>this.instagramRef=instance}
,
and use refs as this.instagramRef.someFunc()
instead of this.refs.ins.someFunc()
and don't forget to set this.instagramRef=null
in a constructor.
REMOVE all createRef()
if used. and change to this method
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With