File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
packages/react-dom/src/__tests__ Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -242,7 +242,7 @@ describe('ReactFunctionComponent', () => {
242242 ReactTestUtils . renderIntoDocument ( < ParentUsingFunctionRef /> ) ;
243243 } ) ;
244244
245- xit ( 'deduplicates ref warnings based on element or owner' , ( ) => {
245+ it ( 'deduplicates ref warnings based on element or owner' , ( ) => {
246246 // When owner uses JSX, we can use exact line location to dedupe warnings
247247 class AnonymousParentUsingJSX extends React . Component {
248248 render ( ) {
@@ -284,10 +284,8 @@ describe('ReactFunctionComponent', () => {
284284 } ) . toErrorDev ( 'Warning: Function components cannot be given refs.' ) ;
285285 // Should be deduped (same internal instance, no additional warnings)
286286 instance2 . forceUpdate ( ) ;
287- // Could not be deduped (different internal instance):
288- expect ( ( ) =>
289- ReactTestUtils . renderIntoDocument ( < AnonymousParentNotUsingJSX /> ) ,
290- ) . toErrorDev ( 'Warning: Function components cannot be given refs.' ) ;
287+ // Could not be differentiated (since owner is anonymous and no source location)
288+ ReactTestUtils . renderIntoDocument ( < AnonymousParentNotUsingJSX /> ) ;
291289
292290 // When owner doesn't use JSX, but is named, we warn once per owner name
293291 class NamedParentNotUsingJSX extends React . Component {
You can’t perform that action at this time.
0 commit comments