Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript React Basics (2018) Thinking in Components Use a Component with JSX

luther wardle
seal-mask
.a{fill-rule:evenodd;}techdegree
luther wardle
Full Stack JavaScript Techdegree Student 18,029 Points

React not rendering component in DOM? Please help!

//my component function PopUp() { return( <div> <h2> Who's feeding Murphy? </h2> <h2>Tell us who you are</h2> <form>

<input /> </form> <button className="feedBtn"> OK </button> </div> ); }

//rendering in DOM ReactDOM.render( <PopUp />, document.getElementById("root") );

on launch i get this error: babel.min.js:7 Uncaught SyntaxError: http://127.0.0.1:8080/app.js: Unexpected token (74:2) 72 | 73 | function PopUp() {

74 | return( | ^ 75 | <div> 76 | <h2> Who's feeding Murphy? </h2> 77 | <h2>Tell us who you are</h2>

1 Answer

Very hard to read the code but I think your problem is on the input tag

Try

<input placeholder="Enter text" value="" />

Question do you have a render function?