Skip to content

Commit 7171302

Browse files
javachemeta-codesync[bot]
authored andcommitted
Remove legacy arch fallback from LayoutConformance (#56440)
Summary: Pull Request resolved: #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
1 parent def621f commit 7171302

File tree

1 file changed

+1
-27
lines changed

1 file changed

+1
-27
lines changed

packages/react-native/Libraries/Components/LayoutConformance/LayoutConformance.js

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,15 @@ export type LayoutConformanceProps = Readonly<{
1818
* compatibility: Layout with the same behavior as previous versions of React Native
1919
*/
2020
mode: 'strict' | 'compatibility',
21-
2221
children: React.Node,
2322
}>;
2423

25-
// We want a graceful fallback for apps using legacy arch, but need to know
26-
// ahead of time whether the component is available, so we test for global.
27-
// This does not correctly handle mixed arch apps (which is okay, since we just
28-
// degrade the error experience).
29-
const isFabricUIManagerInstalled = global?.nativeFabricUIManager != null;
30-
31-
function LayoutConformance(props: LayoutConformanceProps): React.Node {
24+
export default component LayoutConformance(...props: LayoutConformanceProps) {
3225
return (
3326
<LayoutConformanceNativeComponent {...props} style={styles.container} />
3427
);
3528
}
3629

37-
function UnimplementedLayoutConformance(
38-
props: LayoutConformanceProps,
39-
): React.Node {
40-
if (__DEV__) {
41-
const warnOnce = require('../../Utilities/warnOnce').default;
42-
43-
warnOnce(
44-
'layoutconformance-unsupported',
45-
'"LayoutConformance" is only supported in the New Architecture',
46-
);
47-
}
48-
49-
return props.children;
50-
}
51-
52-
export default (isFabricUIManagerInstalled
53-
? LayoutConformance
54-
: UnimplementedLayoutConformance) as component(...LayoutConformanceProps);
55-
5630
const styles = StyleSheet.create({
5731
container: {
5832
display: 'contents',

0 commit comments

Comments
 (0)