React

ReactJS Practical Questions - What happens when th...

25.

What happens when the following render() method executes?

render() {
  return (
    <div>
      <h1>Hello, World!</h1>
    </div>
  );
}

It creates a new component called <h1> inside a <div> element.

It returns the HTML markup <div><h1>Hello, World!</h1></div>.

It updates the content of an existing <h1> element with the text "Hello, World!".

It updates the state of the parent component.