mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Remove legacy arch fallback from LayoutConformance (#56440)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/56440 Remove the `isFabricUIManagerInstalled` guard and `UnimplementedLayoutConformance` fallback since the legacy architecture is no longer supported. Convert to Flow component syntax. Changelog: [Internal] - Removed legacy architecture fallback from `LayoutConformance` Reviewed By: cipolleschi Differential Revision: D100817102 fbshipit-source-id: 37691be8f60eab16fc83fe2747e3c88f876ae755
This commit is contained in:
1 parent
def621f674
commit
7171302cc0
1 file changed
+1
-27
+1
-27
@@ -18,41 +18,15 @@ export type LayoutConformanceProps = Readonly<{
|
||||
* compatibility: Layout with the same behavior as previous versions of React Native
|
||||
*/
|
||||
mode: 'strict' | 'compatibility',
|
||||
|
||||
children: React.Node,
|
||||
}>;
|
||||
|
||||
// We want a graceful fallback for apps using legacy arch, but need to know
|
||||
// ahead of time whether the component is available, so we test for global.
|
||||
// This does not correctly handle mixed arch apps (which is okay, since we just
|
||||
// degrade the error experience).
|
||||
const isFabricUIManagerInstalled = global?.nativeFabricUIManager != null;
|
||||
|
||||
function LayoutConformance(props: LayoutConformanceProps): React.Node {
|
||||
export default component LayoutConformance(...props: LayoutConformanceProps) {
|
||||
return (
|
||||
<LayoutConformanceNativeComponent {...props} style={styles.container} />
|
||||
);
|
||||
}
|
||||
|
||||
function UnimplementedLayoutConformance(
|
||||
props: LayoutConformanceProps,
|
||||
): React.Node {
|
||||
if (__DEV__) {
|
||||
const warnOnce = require('../../Utilities/warnOnce').default;
|
||||
|
||||
warnOnce(
|
||||
'layoutconformance-unsupported',
|
||||
'"LayoutConformance" is only supported in the New Architecture',
|
||||
);
|
||||
}
|
||||
|
||||
return props.children;
|
||||
}
|
||||
|
||||
export default (isFabricUIManagerInstalled
|
||||
? LayoutConformance
|
||||
: UnimplementedLayoutConformance) as component(...LayoutConformanceProps);
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
display: 'contents',
|
||||
|
||||
Reference in new issue
Block a user