@@ -448,39 +448,40 @@ let useGetterPropsCalledChecker = () => noop
448448/* istanbul ignore next */
449449if ( process . env . NODE_ENV !== 'production' ) {
450450 useGetterPropsCalledChecker = ( ...propKeys ) => {
451- const isInitialMountRef = useRef ( true )
452451 const getterPropsCalledRef = useRef (
453452 propKeys . reduce ( ( acc , propKey ) => {
454453 acc [ propKey ] = { }
454+
455455 return acc
456456 } , { } ) ,
457457 )
458458
459459 useEffect ( ( ) => {
460460 Object . keys ( getterPropsCalledRef . current ) . forEach ( propKey => {
461461 const propCallInfo = getterPropsCalledRef . current [ propKey ]
462- if ( isInitialMountRef . current ) {
463- if ( ! Object . keys ( propCallInfo ) . length ) {
464- // eslint-disable-next-line no-console
465- console . error (
466- `downshift: You forgot to call the ${ propKey } getter function on your component / element.` ,
467- )
468- return
469- }
462+
463+ if ( ! Object . keys ( propCallInfo ) . length ) {
464+ // eslint-disable-next-line no-console
465+ console . error (
466+ `downshift: You forgot to call the ${ propKey } getter function on your component / element.` ,
467+ )
468+ return
470469 }
471470
472471 const { suppressRefError, refKey, elementRef} = propCallInfo
473472
474- if ( ( ! elementRef || ! elementRef . current ) && ! suppressRefError ) {
473+ if ( suppressRefError ) {
474+ return
475+ }
476+
477+ if ( ! elementRef ?. current ) {
475478 // eslint-disable-next-line no-console
476479 console . error (
477480 `downshift: The ref prop "${ refKey } " from ${ propKey } was not applied correctly on your element.` ,
478481 )
479482 }
480483 } )
481-
482- isInitialMountRef . current = false
483- } )
484+ } , [ ] )
484485
485486 const setGetterPropCallInfo = useCallback (
486487 ( propKey , suppressRefError , refKey , elementRef ) => {
0 commit comments