Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript React Basics Thinking in Components Use a Component with JSX

luther wardle
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: 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

Edgar Gil
Edgar Gil
866 Points

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


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

Question do you have a render function?