Render-react-on-the-server-with-rendertostring

Tell us what’s happening:

I must be doing something wrong, and just don’t know what its asking me to do, because I can’t understand why this isnt working.

Your code so far



class App extends React.Component {
  constructor(props) {
    super(props);
  }
  render() {
    return <div/>
  }
};

// change code below this line
ReactDOMServer.renderToString('App');

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36.

Link to the challenge:

Uhm…have you tried the following?
ReactDOMServer.renderToString('<App />');

Ahh jeez… thank you!! it worked without the quotes…

ReactDOMServer.renderToString(<App />);

2 Likes