score:0

Accepted answer

to use ref in react, you need to pass a callback to ref in your componets

dont

ref="pickamonth"
// or
 ref={pickamonth}

do

ref = {(componentref) => refvariable = componentref
}

ref = {ref => pickamonth = ref}

// somwhere in your code, now you can do this
pickamonth.show();

score:0

in functional components ref have their values in 'current' property

const handleclickmonthbox=(e)=> {
    pickamonth.**current**.show()
}

Related Query

More Query from same tag