mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Apple changed the sizes of the UISwitchComponent and now, if you build an iOs app using the <Switch> component, the layout of the app will be broken because of wrong layout measurements. This has been reported also by [https://github.com/facebook/react-native/issues/52823](https://github.com/facebook/react-native/issues/52823). The `<Switch>` component was using hardcoded values for its size. This change fixes the problem by: - Using codegen for interface only - Implementing a custom Sadow Node to ask the platform for the Switch measurements - Updating the JS layout to wrap the size around the native component. ## Changelog: [iOS][Fixed] - Fix Switch layout to work with iOS26 Pull Request resolved: https://github.com/facebook/react-native/pull/53067 Test Plan: Tested locally with RNTester. | iOS Version | Before | After | | --- | --- | --- | | < iOS 26 |  |  | | >=--sanitized-- Rollback Plan: Differential Revision: D79653120 Pulled By: cipolleschi