I am making a project on react. So, I didn't get too far(:-P). Well my problem is that ReactDOM.render()
is not rendering my elements. I am relatively new to React, so cannot debug it. Here is it:-
You have two errors in the code
It's React.Component
, not React.component
In the render-function of the Header component, you have a new line after return
- Javascript automatically adds a semicolon here, you can prevent this with either writing the first JSX-line after the return, or you can wrap your return statement in parentheses
So either write:
return (
<div>
...
)
or
return <div>
...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.