From 9106f11d27d3e927696939f906c8cd5b5aa4a3ff Mon Sep 17 00:00:00 2001 From: Albert Vila Calvo Date: Thu, 30 Dec 2021 20:16:35 +0100 Subject: [PATCH] (Frontend) Add missing 'props' to React class constructors and super() call --- .../02_trivia_api/starter/frontend/src/components/FormView.js | 2 +- .../02_trivia_api/starter/frontend/src/components/Question.js | 4 ++-- .../starter/frontend/src/components/QuestionView.js | 4 ++-- .../02_trivia_api/starter/frontend/src/components/QuizView.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/projects/02_trivia_api/starter/frontend/src/components/FormView.js b/projects/02_trivia_api/starter/frontend/src/components/FormView.js index 93ceffb566e..fa96e491874 100755 --- a/projects/02_trivia_api/starter/frontend/src/components/FormView.js +++ b/projects/02_trivia_api/starter/frontend/src/components/FormView.js @@ -5,7 +5,7 @@ import '../stylesheets/FormView.css'; class FormView extends Component { constructor(props){ - super(); + super(props); this.state = { question: "", answer: "", diff --git a/projects/02_trivia_api/starter/frontend/src/components/Question.js b/projects/02_trivia_api/starter/frontend/src/components/Question.js index 42aafb6cf7c..04ea31d4805 100755 --- a/projects/02_trivia_api/starter/frontend/src/components/Question.js +++ b/projects/02_trivia_api/starter/frontend/src/components/Question.js @@ -2,8 +2,8 @@ import React, { Component } from 'react'; import '../stylesheets/Question.css'; class Question extends Component { - constructor(){ - super(); + constructor(props){ + super(props); this.state = { visibleAnswer: false } diff --git a/projects/02_trivia_api/starter/frontend/src/components/QuestionView.js b/projects/02_trivia_api/starter/frontend/src/components/QuestionView.js index 789814cf10e..474633e2adb 100755 --- a/projects/02_trivia_api/starter/frontend/src/components/QuestionView.js +++ b/projects/02_trivia_api/starter/frontend/src/components/QuestionView.js @@ -6,8 +6,8 @@ import Search from './Search'; import $ from 'jquery'; class QuestionView extends Component { - constructor(){ - super(); + constructor(props){ + super(props); this.state = { questions: [], page: 1, diff --git a/projects/02_trivia_api/starter/frontend/src/components/QuizView.js b/projects/02_trivia_api/starter/frontend/src/components/QuizView.js index 1e3b8236c80..19f488e8c93 100644 --- a/projects/02_trivia_api/starter/frontend/src/components/QuizView.js +++ b/projects/02_trivia_api/starter/frontend/src/components/QuizView.js @@ -7,7 +7,7 @@ const questionsPerPlay = 5; class QuizView extends Component { constructor(props){ - super(); + super(props); this.state = { quizCategory: null, previousQuestions: [],