Not able to use scrollToBottom in Ionic 4 with React

I’m using the Ionic V4 with React for Capacitor in that I want to use the ion-content. like scrollByPoint, scrollToBottom, scrollToPoint, scrollToTop, getScrollElement etc. This methods we can easily use with Angular. I have already tried scrollToBottom.
where I’m trying to do,

getContent() {
return document.querySelector(‘ion-content’);
}
scrollToBottom = () => {
this.getContent().scrollToBottom(500);
}

It’s showing me error, "Object is possibly ‘null’. "
How can I achieve this. Thanks in advance for any help.