5

Exception thrown while executing UI block: 'parentNode' is a required parameterException thrown while executing UI block: 'parentNode' is a required parameter

im getting this error when trying to render a list in react native. what can i do about it ?

2
  • 1
    Can you post the code of the component you are trying to render? Commented Apr 12, 2020 at 12:03
  • Without your code sample, we won't be able to give accurate input. Commented Apr 13, 2020 at 8:10

5 Answers 5

4

Had the same problem, coming from react-native Animated

What worked for me :

Disable useNativeDriver :

/* Error */
Animated.timing(fade, {
  toValue: 20,
  duration: 800,
  useNativeDriver: true <--- change to false
}).start();
Sign up to request clarification or add additional context in comments.

Comments

4

the reason for this error is are you using parameter name same as an already declared variable in that component, like below

let a;
this.props.navigation.navigate(screen,{a:1})

you can fix the error by using a new parameter name like

let a;
this.props.navigation.navigate(screen,{b:1})

Comments

1

This error happened to me when trying to dispatch an Animated timing event and instead of accessing an animated value within an Animated.View component I was using a regular rn View.

2 Comments

I was getting the same error. Resolved it by removing the borderColor, borderRadius & borderWidth from Text styles.
I had useMemo elements inside the animated component and what is worse influenced on other app's parts (the animation worked well...). Removed useMemo from memorized component's parts and everything started working.
1

I have received this error for my Victory Native bar chart. There was problems with bar clicks on Android and I have solved it by providing a Svg container component:

<VictoryChart containerComponent={isAndroid ? <Svg /> : undefined}>

You also need to wrap the chart with a container to bar clicks work on iOS but don't use containerComponent instead wrap it with an outside container:

interface Props {
  children: React.ReactNode;
  width?: number;
  height?: number;
}

const ChartWrapper = (props: Props) => {
  const {children, height, width} = props;
  return isAndroid ?
    <View style={{width, height}}>{children}</View> :
    <Pressable style={{height, width}}>{children}</Pressable>;
};

in chart screen:

<ChartWrapper width={windowWidth}>
  <VictoryChart containerComponent={isAndroid ? <Svg /> : undefined}>
    <VictoryBar />
  </VictoryChart>
</ChartWrapper>

Comments

0

We had 'react-native-fast-image' version "8.6.3" in our code base

Before: The tintColor was passed as a prop directly to the FastImage component. This is being removed from the props and being applied directly in the style.

 <FastImage
      tintColor={'red'}//remove this line
      resizeMode={FastImage.resizeMode.contain}
      source={require('images/home.png')}
      style={{
        priority: FastImage.priority.normal,
        width: iconSize,
        height: iconSize,
      }}
    />

After: The tintColor is now directly included in the style object of the FastImage component.

<FastImage
      resizeMode={FastImage.resizeMode.contain}
      source={require('images/home.png')}
      style={{
        priority: FastImage.priority.normal,
        width: iconSize,
        height: iconSize,
        tintColor:'red'//add here
      }}
    />

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.