@@ -103,7 +103,6 @@ describe('ref', () => {
103103 </ Holder > ,
104104 ) ;
105105 expect ( supportRef ( FC ) ) . toBeFalsy ( ) ;
106- // expect(supportRef(holderRef.current.props.children)).toBeFalsy();
107106 } ) ;
108107
109108 it ( 'arrow function component' , ( ) => {
@@ -117,7 +116,7 @@ describe('ref', () => {
117116 </ Holder > ,
118117 ) ;
119118 expect ( supportRef ( FC ) ) . toBeFalsy ( ) ;
120- expect ( supportRef ( holderRef . current . props . children ) ) . toBeFalsy ( ) ;
119+ expect ( supportRef ( holderRef . current . props . children ) ) . toBeTruthy ( ) ; // React19 ref 收拢到了 props 里面,默认支持
121120 } ) ;
122121
123122 it ( 'forwardRef function component' , ( ) => {
@@ -163,7 +162,7 @@ describe('ref', () => {
163162 </ Holder > ,
164163 ) ;
165164 expect ( supportRef ( MemoFC ) ) . toBeFalsy ( ) ;
166- expect ( supportRef ( holderRef . current . props . children ) ) . toBeFalsy ( ) ;
165+ expect ( supportRef ( holderRef . current . props . children ) ) . toBeTruthy ( ) ; // React19 ref 收拢到了 props 里面,默认支持
167166 } ) ;
168167
169168 it ( 'memo of forwardRef function component' , ( ) => {
@@ -196,7 +195,7 @@ describe('ref', () => {
196195 it ( 'FC' , ( ) => {
197196 const FC = ( ) => < div /> ;
198197 const RefFC = React . forwardRef ( FC ) ;
199- expect ( supportNodeRef ( < FC /> ) ) . toBeFalsy ( ) ;
198+ expect ( supportNodeRef ( < FC /> ) ) . toBeTruthy ( ) ; // React19 ref 收拢到了 props 里面,默认支持
200199 expect ( supportNodeRef ( < RefFC /> ) ) . toBeTruthy ( ) ;
201200 } ) ;
202201
0 commit comments