REACT JS QUIZ
1 .
How do you set a default value for an uncontrolled form field?

Correct Answer : Option (B)

Use the defaultValue property
  Show Answer
2 .
How do you invoke setDone only when component mounts, using hooks?
function MyComponent(props) {
  const [done, setDone] = useState(false);

  return <h1>Done: {done}</h1>;
}

Correct Answer : Option (C)

useEffect(() => { setDone(true); }, [setDone]);
  Show Answer
3 .
What value of button will allow you to pass the name of the person to be hugged?
class Huggable extends React.Component{
	hug(id){
		console.log("hugging " + id);
	}

	render() {
		let name = "kitteh";
		let button = // Missing Code
		return button;
	}
}

Correct Answer : Option (A)

<button onClick={(name) => this.hug(name)>Hug Button</button>
  Show Answer
4 .
Which Hook could be used to update the document's title?

Correct Answer : Option (A)

useEffect(function updateTitle() { document.title = name + ' ' + lastname; });
  Show Answer
5 .
What do you need to change about this code to get it to run?
class clock extends React.Component {
  render() {
    return <h1>Look at the time: {this.props.time}</h1>;
  }
}

Correct Answer : Option (B)

Capitalize clock
  Show Answer