diff --git a/packages/react-native-renderer/src/ReactFabricHostConfig.js b/packages/react-native-renderer/src/ReactFabricHostConfig.js index 69f0f57040c8f..9b6c1adf2a32c 100644 --- a/packages/react-native-renderer/src/ReactFabricHostConfig.js +++ b/packages/react-native-renderer/src/ReactFabricHostConfig.js @@ -191,11 +191,6 @@ export function createInstance( } } - invariant( - type !== 'RCTView' || !hostContext.isInAParentText, - 'Nesting of within is not currently supported.', - ); - const updatePayload = create(props, viewConfig.validAttributes); const node = createNode( diff --git a/packages/react-native-renderer/src/ReactNativeHostConfig.js b/packages/react-native-renderer/src/ReactNativeHostConfig.js index 63bb4d2eeb944..4b0ac12c2bd5d 100644 --- a/packages/react-native-renderer/src/ReactNativeHostConfig.js +++ b/packages/react-native-renderer/src/ReactNativeHostConfig.js @@ -102,11 +102,6 @@ export function createInstance( } } - invariant( - type !== 'RCTView' || !hostContext.isInAParentText, - 'Nesting of within is not currently supported.', - ); - const updatePayload = create(props, viewConfig.validAttributes); UIManager.createView( diff --git a/packages/react-native-renderer/src/__tests__/ReactFabric-test.internal.js b/packages/react-native-renderer/src/__tests__/ReactFabric-test.internal.js index 5681aa7661795..59cf0f8bf496e 100644 --- a/packages/react-native-renderer/src/__tests__/ReactFabric-test.internal.js +++ b/packages/react-native-renderer/src/__tests__/ReactFabric-test.internal.js @@ -610,7 +610,7 @@ describe('ReactFabric', () => { expect(snapshots).toMatchSnapshot(); }); - it('should throw when is used inside of a ancestor', () => { + it('should not throw when is used inside of a ancestor', () => { const Image = createReactNativeComponentClass('RCTImage', () => ({ validAttributes: {}, uiViewClassName: 'RCTImage', @@ -624,16 +624,13 @@ describe('ReactFabric', () => { uiViewClassName: 'RCTView', })); - expect(() => - ReactFabric.render( - - - , - 11, - ), - ).toThrow('Nesting of within is not currently supported.'); + ReactFabric.render( + + + , + 11, + ); - // Non-View things (e.g. Image) are fine ReactFabric.render( diff --git a/packages/react-native-renderer/src/__tests__/ReactNativeMount-test.internal.js b/packages/react-native-renderer/src/__tests__/ReactNativeMount-test.internal.js index e590b9f63534e..67ccf4fc0c7fe 100644 --- a/packages/react-native-renderer/src/__tests__/ReactNativeMount-test.internal.js +++ b/packages/react-native-renderer/src/__tests__/ReactNativeMount-test.internal.js @@ -486,7 +486,7 @@ describe('ReactNative', () => { expect(mockArgs.length).toEqual(0); }); - it('should throw when is used inside of a ancestor', () => { + it('should not throw when is used inside of a ancestor', () => { const Image = createReactNativeComponentClass('RCTImage', () => ({ validAttributes: {}, uiViewClassName: 'RCTImage', @@ -500,14 +500,12 @@ describe('ReactNative', () => { uiViewClassName: 'RCTView', })); - expect(() => - ReactNative.render( - - - , - 11, - ), - ).toThrow('Nesting of within is not currently supported.'); + ReactNative.render( + + + , + 11, + ); // Non-View things (e.g. Image) are fine ReactNative.render(