Help how to Render React on the Server with renderToString

Help how to Render React on the Server with renderToString
0

#1

Please how to render a react component on server with renderToString()??

This is what I’ve written - what is wrong?



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 (Windows NT 6.1; WOW64; rv:62.0) Gecko/20100101 Firefox/62.0.

Link to the challenge:
https://learn.freecodecamp.org/front-end-libraries/react/render-react-on-the-server-with-rendertostring


#2

Hi,
I think you forgot to place App inside of “(< />)”


#3

Thanks @KoniKodes i did it.


#4

Glad it worked :blush: