Skip to content

RNVideo in overlay prevents the componentDidUnmount from being triggered #8247

@aliraza-noon

Description

@aliraza-noon

What happened?

When showing a Overlay with a RNVideo component from react-native-video, the Video prevents the view from being unmounted on dismiss. I noticed this because my RNVideo was still playing in the background when I dismissed the overlay.

In other words, once you have a video playing, this code:

useEffect(() => {
  console.log('mounted');
  return () => {
    console.log('unmounted');
  };
}, []);

will only print mounted to the console, unmounted will never be called.

What was the expected behaviour?

I expect it to actually unmount like a normal Screen (push) does.

Was it tested on latest react-native-navigation?

  • I have tested this issue on the latest react-native-navigation release and it still reproduces.

Help us reproduce this issue!

  1. Show overlay with video
  2. Dismiss overlay
  3. Notice the overlay component still being "mounted" in native view hierarchy (video/audio still playing)

In what environment did this happen?

React Native Navigation version: 7.48.0
React Native version: 0.77
Has Fabric (React Native's new rendering system) enabled: (yes/no) no
Node version: 20
Device model: iPhone 17 Simulator
iOS version: 26

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions