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} />
);
Source: stackoverflow.com
Related Query
- Why does React.createRef() for material-ui Button element in TypeScript not work correctly?
- Event listener for button does not work unless page is refreshed in React
- Why does setting true/false value does not work for React states?
- Why does my react button work with an arrow function, but not when I give it a function?
- WebStorm auto completion does not work for React js
- Why does hot reloading not work for reactjs visual studio 2019 template
- Why does TypeScript assertion of object literal `{a}` work with interface `{a, b}` but not `{a?, b}`
- In React why does calling a function from another function in our code not work and display?
- Why does custom Button component using MUI Button not work on hover with Tooltip?
- React + ApolloProvider + Typescript = "JSX element class does not support attributes" error
- React importing image does not work for CSS
- Why ES6 ComputedPropertyName does not work with this react js code?
- selected option in select element does not work in react
- react onChange function does not work for select tag
- React suggestions and autocomplete does not work for files with js extension in VSCode
- Why does window.location not work in my react component?
- Why does useEffect React Hook not work properly with dependency?
- disabled={true} HTML button attribute does not work right in JavaScript + React
- Bootstrap Navbar does not work in React JS for single page website
- React Dumb component Typescript error: Element is not a constructor function for JSX elements, property 'render' is missing
- Why does arrow function work but regular function does not React JS
- I just used react context, why does static context not work if I console on other components
- TypeScript errors in React Class Component property does not exist on type 'Readonly<{}>', not sure how to set types for state
- react hook for setting the document title does not work on ssr
- React router does not reload component if same element is used for two paths
- Button does not work using function component in react
- Why does eval() not work for imported functions?
- React TypeScript - Why does Boolean() behave differently than double NOT (!!) operator when trying to conditionally render with && operator?
- Why does a React JSX element event handler not use parentheses similar to a html event handler?
- Why does trim() not work for setting a string within an object (related to type, not the nature of the state)
More Query from same tag
- More Efficient Way to Destructure with Conditional in ReactJs
- React: Wait until all assets are loaded
- Pass props to makeStyles and use in CSS shorthand property in Material UI
- Do I really need the Hook useEffect() here?
- ReactJS good practices using Hooks and Redux. Should I use useSelector in each component, or I should pass via props?
- React container props child passing
- react material along with react infinite scroll component table body
- How to make production environmental variables with AWS Amplify and Next.js
- React event listener not working in production on Netlify
- String.split() method on object property set via API
- How to pass props from parent to grandchild component in react
- Not Able to Change the Color of the alert Message in javascript react
- icon onClick issue
- Unable to do operations on specific thing
- CORS Error on Wikipedia API
- React render a select field multiple times
- ReactJS - pass object keys and values as props to div
- LogBox ignore warnings not working in react native?
- react js is getting Cannot read property 'map' of undefined
- JSX loop in React
- Error happens when API returns JSON, Each child in a list should have a unique "key" prop
- How to render more elements of list on button click - Meteor / React
- npm ERR! enoent undefined ls-remote in React.js
- React: Create a new html element on click
- CSRF verification failed error with react, axios and DRF
- Creating a calculated field using ant forms
- ReactJS routing issue after deployment in production
- How to synchronize Redux and Relay?
- How to use the "< >" in React JSX
- How to skip the update of state inside getDerivedStatefromProps() in childComponent only for the first time of rendering the childComponent