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

Viewed 4175

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 ?

4 Answers

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})

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();

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.

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>

Related