score:1
try these code:
<script type="text/babel">
class myclass extends react.component{
render() {
return(<h1>hello react componets!</h1>);
}
}
reactdom.render(
<h1><myclass/></h1>,
document.getelementbyid('container')
);
</script>
score:1
your problem is here,
<h1>myclass</h1>, //this is not a react component, this will only print `myclass` as text on page
just change,
reactdom.render(
<h1>myclass</h1>,
document.getelementbyid('container')
);
to this,
reactdom.render(
<myclass />,
document.getelementbyid('container')
);
note: correct the typo in your code,
class myclass extends react.componet
should be class myclass extends react.component{
Source: stackoverflow.com
Related Query
- How to render FluentUI controls in a HTML page similar to rendering React Components in a script tag inside a Div
- Scroll to the top of the page after render in react.js
- Rendering React components with promises inside the render method
- Why IE 11 display blank page rendering react app
- React.js: Stop render from scrolling to top of page
- Next.JS - Access `localStorage` before rendering page
- React rendering SVG overwrites other SVGs on the page
- how to render a react component using ReactDOM Render
- React Paginate Second Instance on same page does not re render
- Next.js link doesn't render with page scrolled at the top
- Render blocking react.js and pageSpeed / page rank
- Keeping session alive after page refresh with server side rendering using react.js
- Rails not rendering public/index.html file; blank page in browser
- Enzyme shallow render is rendering children components
- Redirect changing page URL but not rendering new page
- ReactJS server side rendering fo single page application
- "material-table" - How to add more rows per page and fix rendering - ReactJs
- Render a react app in a non react web page
- page is not rendering when I click back button with react-router
- Reactjs routing causing page render issues
- How to render a static html page in ReactJS?
- Render FlatList footer at bottom if list doesn't extend off page
- React-Redux how to prevent page from rendering before redirect
- How to properly render a 404 page in React with React-Router?
- React js : Rendering multiple index html in a single page applications
- Pseudo Selector in Material-UI withStyles not rendering to page
- Why react new page render from the bottom of the screen?
- Server Side Render Dynamic Page based on Route Param
- React Route render blank page
- ReactDOM to render multiple elements using the same class at ones?
More Query from same tag
- Both if and else condition are executed
- Change value in react js on window resize
- How do I dynamically set HTML5 data- attributes using react?
- Importing GeoJSON file to React-Leaflet
- React.js - Using one component multiple times with different settings
- How can we show Laravel Validation response in ReactJS render?
- Why no parentheses on a function
- How to run React code from inner HTML file?
- refetchQueries in Mutation Component of React Apollo Client is not working?
- How to specify a style block in react component?
- How to lift state with an on-click event
- Open Dialog From Other Page In React
- React: "Cmd-Click" a button that navigates somewhere. Best Practices?
- React Hook useEffect has a missing dependency:
- react-bootstrap-table-next dependency tree issue
- React | why does .map work when .forEach creates a ' Maximum call stack size exceeded' error
- React and multiple timed events
- Reactivesearch - search from any route
- Is it possible to place useEffect inside a if statement?
- react-navigation Screen that conceals TabBar from nested StackNavigator
- How to access cookies correctly in express application
- One common dialog for different types of input data
- How to get rendered JSX in React?
- Why can't this component be mounted?
- How can I dynamically render components when enter an input
- Window.scrollTo is undefined in React
- Loop through react to set state
- Browserify-ed code on a server: how to get "window", "location" and other "window" properties and typically browser objects?
- OpenSeadragon missing prop in types definition
- Fieldset like div container with headers/subheader