score:0

you need to create ref with htmldivelement.

createref<htmldivelement>()

so, this would be better.

private streetviewref = createref<htmldivelement>();

score:4

take a look here https://www.selbekk.io/blog/2020/05/forwarding-refs-in-typescript/

the correct way to type a forwardref component is:

type props = {};
const button = react.forwardref<htmlbuttonelement, props>(
  (props, ref) => <button ref={ref} {...props} />
);

Related Query

More Query from same tag