File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -2590,15 +2590,20 @@ describe('React', () => {
2590
2590
} )
2591
2591
2592
2592
it ( 'should not override ref property when not asked to.' , async ( ) => {
2593
+ type RootStateType = { }
2593
2594
const store = createStore ( ( ) => ( { } ) )
2594
- interface RefReceiverProps {
2595
- ref : React . Ref < HTMLSpanElement | null >
2596
- }
2597
- function RefReceiver ( props : RefReceiverProps ) {
2598
- const { ref} = props
2599
- return < span ref = { ref } />
2600
- }
2601
- const DecoratedRefReceiver = connect ( ) ( RefReceiver )
2595
+ type RefReceiverPropsType = { }
2596
+ const RefReceiver = React . forwardRef < HTMLSpanElement , RefReceiverPropsType > (
2597
+ ( props : RefReceiverPropsType , ref ) => < span ref = { ref } />
2598
+ ) ;
2599
+ type RefReceiverNoDispatchType = null
2600
+ const decorator = connect <
2601
+ RefReceiverPropsType ,
2602
+ RefReceiverNoDispatchType ,
2603
+ RefReceiverPropsType ,
2604
+ RootStateType
2605
+ > ( null , null )
2606
+ const DecoratedRefReceiver = decorator ( RefReceiver )
2602
2607
const testRef = React . createRef < HTMLSpanElement > ( )
2603
2608
rtl . render (
2604
2609
< ProviderMock store = { store } >
You can’t perform that action at this time.
0 commit comments