After calling setTimeOut(Question, 3000) I receive the error "Cannot call a class as a function". "Question" needs to be a class in order to get the lifecycle methods that classes receive.
The only answer I have found so far is to include "extends React.Component" on the class, which I have.
import React from 'react';
import Question from './Question';
setTimeout(Question, 3000);
function Congratulations(props) {
return(
<div>
<h1>Congraulations you are the champion.</h1>
<h2>Your Score: {props.score}</h2>
</div>
)
}
export default Congratulations;
The first few lines of Question component class follows.
export default class Question extends React.Component {
constructor(props) {
super(props);
I would like for Question to appear on the DOM after 3 seconds.