SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 0 C++

Remove views from their parent on recycle (#49851)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49851

Android doesn't allow to mount a view that already has a parent. View recycling removes all children from a view. But if some views don't support recycling, they'll keep a reference to their children. Children being recycled will cause an exception when being mounted.

This diff removes the view from its parent when it is being recycled. This guarantees that whatever the parent, the view can be mounted after being recycled.

bypass-github-export-checks

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D70672120

fbshipit-source-id: 023d8fb48982d6d9ae7f9c537f7f2bb21cf15066
N
Nick Lefever committed
1114f4c35a95ae583dd45dd27d2f10f246097db4
Parent: a51fa6c
Committed by Facebook GitHub Bot <[email protected]> on 3/6/2025, 4:34:02 PM