react-native-collapsible icon indicating copy to clipboard operation
react-native-collapsible copied to clipboard

ReactNativeFiberHostComponent: Calling `getNode()` on the ref of an Animated component is no longer necessary.

Open mrusmanali opened this issue 5 years ago • 5 comments

ReactNativeFiberHostComponent: Calling getNode() on the ref of an Animated component is no longer necessary. You can now directly use the ref instead. This method will be removed in a future release.

The code is working fine I am but getting this warning. Here is my implementation.

` import React, {useState} from 'react'; import { Image, View, Text, TouchableOpacity } from 'react-native'; import Accordion from 'react-native-collapsible/Accordion';

import styles from './styles';

export default () => { const [active, setActive] = useState([0]) const SECTIONS = ['1','1','1','1','1','1','1'];

const renderHeader = (section, _, isActive) => {
    return (
        <View><Text>Header</Text></View>
    )
}
const renderContent = (section, _, isActive) => {
    return (
        <View><Text>Content</Text></View>
    )
}
const updateSections = section => {
    setActive(section)
}

return ( <Accordion activeSections={active} sections={SECTIONS} touchableComponent={(props) => <TouchableOpacity {...props} />} renderHeader={renderHeader} renderContent={renderContent} onChange={updateSections} /> ) } `

mrusmanali avatar Jun 24 '20 08:06 mrusmanali

Same problem +1

LuciferLat avatar Jun 24 '20 10:06 LuciferLat

goto node module -> react-native-collapsible -> collapisble.js on line# 88 replace this.contentHandle.getNode().measure((x, y, width, height) => {

with

let ref; if (typeof this.contentHandle.measure === 'function') { ref = this.contentHandle; } else { ref = this.contentHandle.getNode(); } ref.measure((x, y, width, height) => {

A pull request is also created! :)

noumansakhawat-dev avatar Jun 26 '20 13:06 noumansakhawat-dev

Same problem ! +1

dmantelli avatar Jun 30 '20 14:06 dmantelli

Same issue. Fixed with code above.

jbromberg avatar Jun 30 '20 17:06 jbromberg

Yup, same here guys after update to RN 62

outaTiME avatar Jul 01 '20 00:07 outaTiME