score:3
Accepted answer
document.getElementsByTagName('body')
returns an array of elements. So extracting the first element will fix your error:
ReactDOM.render(
<Hello compiler="TypeScript" framework="React" />,
document.getElementsByTagName("body")[0]
);
Or you could use the more classic document.getElementsById("root")
:
ReactDOM.render(
<Hello compiler="TypeScript" framework="React" />,
document.getElementById("root")
);
This assumes that the HTML contains a div with an id of root
:
<body>
<div id="root"></div>
</body>
Source: stackoverflow.com
Related Query
- 'TS2769: No overload matches this call' consuming React component
- React + TypeScript error: No overload matches this call
- React Onclick - No overload matches this call
- Typescript + React - No overload matches this call
- React typescript, useReducer TS2769: No overload matches this call
- No overload matches this call Error while using css-in-js in Typescript, Webpack, React Project
- React query - useQuery() No overload matches this call
- Error on styled component instance with TypeScript: No overload matches this call
- No overload matches this call | Typescript + React + Material UI
- No overload matches this call on simple react app
- React TypeScript: react-markdown no overload matches this call
- No overload matches this call in ApexCharts with React and Typescript
- No overload matches this call from react
- No overload matches this call in react testing library
- No overload matches this call when usign styled-components
- No overload matches this call in Cors TypeScript
- Materia-ui and typescript No overload matches this call
- Typescript Routing Error - No overload matches this call
- No overload matches this call in saga call effect
- .js component in a .tsx component - no overload matches this call/property does not exist on type IntrinsicAttributes
- React-Router + Typescript error while wrapping component with Router "No overload matches this call"
- TypeScript and styled-components: No overload matches this call
- Typescript error with styled-components and AS TS2769: No overload matches this call
- No overload matches this call.in react
- Typescript papaparse No overload matches this call
- Typescript ConnectedRouter No overload matches this call
- No overload matches this call
- No overload matches this call Error on TSX
- No overload matches this call. React
- Time consuming function call in componentDidMount of React component
More Query from same tag
- Display new button on onClick(); ReactJS
- How can i use spread only one time?
- How can I use init state without using Provider and connect() in Redux
- How to test controlled React components with cypress-react-unit-test
- GETTING ERROR : Warning: Failed prop type: Invalid prop `children` supplied to `Form`, expected a ReactNode
- How to import GIF in NextJS
- How To Get New Persona Behavior in PeoplePicker
- react bootstrap acoordion cannot use pre tag or css white space for new line
- How do I fix Webpack from mangling my code in production?
- Dispatch Redux action in React
- `Gatsby Build` Outputs Shuffled Array Objects Incorrectly
- Access Data from Selected Sheet in Google Picker on React App
- Testing Reselect Selectors
- React / TypeScript serviceWorker Update function warning how to resolve
- How can I get slugs from requested page in getStaticProps or getStaticPaths?
- NoMethodError (undefined method `permit' for #<Array:0x0000563ea01dba98>):
- How to check if there is an item in an array that exists in another array?
- React date picker filtering dates issue
- how to add/remove data to state depending on if the checkbox was checked and then unchecked
- submit form in react with variable set of inputs?
- React prop validation for date objects
- React page does not rerender on url query change
- How to know which file has been uploaded from multiple inputs of type file in reactjs using Express API
- ReactTestUtils findRenderedComponentWithType throwing error not detecting by chai?
- how can I make align-items work in reactJS?
- ReactJS: How do I open an Material-UI Accordion programmatically?
- React component not showing, also not giving any errors
- popper hiding the page components
- onMouseEnter onMouseLeave Error: Too many re-renders react
- Symfony 4 how to setup SPA ( single page app ) with React?