From bd58728b1567ce3965ba0d96d0148d18061d88c6 Mon Sep 17 00:00:00 2001 From: Jesse Hurdle Date: Wed, 20 Oct 2021 20:31:39 -0400 Subject: [PATCH] fix scope issue --- src/App.js | 3 +++ src/Routes.js | 2 ++ src/components/Comment.js | 1 + src/components/CommentForm.js | 2 +- src/components/Comments.js | 1 + src/components/Login.js | 2 +- src/components/Navbar.js | 2 +- src/components/PostCreate.js | 2 +- src/components/PostDetail.js | 2 +- src/components/PostForm.js | 2 ++ src/components/PostFormButtons.js | 2 ++ src/components/PostList.js | 2 +- src/components/PostListItem.js | 2 +- src/components/PostUpdate.js | 2 +- 14 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/App.js b/src/App.js index 2df106e..a3507ff 100644 --- a/src/App.js +++ b/src/App.js @@ -1,4 +1,7 @@ +import React from "react"; + import PostList from "./components/PostList"; + import "bootstrap/dist/css/bootstrap.min.css"; import "./App.css"; diff --git a/src/Routes.js b/src/Routes.js index 7328319..8c90fde 100644 --- a/src/Routes.js +++ b/src/Routes.js @@ -1,4 +1,6 @@ +import React from "react"; import { BrowserRouter, Switch, Route } from "react-router-dom"; + import App from "./App"; import Navbar from "./components/Navbar"; import PostCreate from "./components/PostCreate"; diff --git a/src/components/Comment.js b/src/components/Comment.js index 1b84baf..2c21ecb 100644 --- a/src/components/Comment.js +++ b/src/components/Comment.js @@ -1,3 +1,4 @@ +import React from "react"; import { useParams } from "react-router-dom"; import UserService from "../services/user.service"; diff --git a/src/components/CommentForm.js b/src/components/CommentForm.js index 3448bac..4de037f 100644 --- a/src/components/CommentForm.js +++ b/src/components/CommentForm.js @@ -1,4 +1,4 @@ -import { useState, useEffect } from "react"; +import React, { useState, useEffect } from "react"; import { useParams } from "react-router-dom"; import AuthService from "../services/auth.service"; diff --git a/src/components/Comments.js b/src/components/Comments.js index 3f2753a..b8d4fcc 100644 --- a/src/components/Comments.js +++ b/src/components/Comments.js @@ -1,3 +1,4 @@ +import React from "react"; import uniqid from "uniqid"; import Comment from "./Comment"; diff --git a/src/components/Login.js b/src/components/Login.js index 9cf8f77..c132c8b 100644 --- a/src/components/Login.js +++ b/src/components/Login.js @@ -1,4 +1,4 @@ -import { useState, useRef } from "react"; +import React, { useState, useRef } from "react"; import Form from "react-validation/build/form"; import Input from "react-validation/build/input"; import CheckButton from "react-validation/build/button"; diff --git a/src/components/Navbar.js b/src/components/Navbar.js index 78fb643..265f17d 100644 --- a/src/components/Navbar.js +++ b/src/components/Navbar.js @@ -1,4 +1,4 @@ -import { useState, useEffect } from "react"; +import React, { useState, useEffect } from "react"; import { Link } from "react-router-dom"; import AuthService from "../services/auth.service"; diff --git a/src/components/PostCreate.js b/src/components/PostCreate.js index 7195456..693c5ba 100644 --- a/src/components/PostCreate.js +++ b/src/components/PostCreate.js @@ -1,4 +1,4 @@ -import { useState, useEffect } from "react"; +import React, { useState, useEffect } from "react"; import PostForm from "./PostForm"; import PostFormButtons from "./PostFormButtons"; diff --git a/src/components/PostDetail.js b/src/components/PostDetail.js index 63fee82..4bb3265 100644 --- a/src/components/PostDetail.js +++ b/src/components/PostDetail.js @@ -1,4 +1,4 @@ -import { useState, useEffect, useCallback } from "react"; +import React, { useState, useEffect, useCallback } from "react"; import { useParams, Link } from "react-router-dom"; import Switch from "react-switch"; diff --git a/src/components/PostForm.js b/src/components/PostForm.js index e57b830..52dfd06 100644 --- a/src/components/PostForm.js +++ b/src/components/PostForm.js @@ -1,3 +1,5 @@ +import React from "react"; + const PostCreateForm = (props) => { const handleChangeTitle = (e) => { e.preventDefault(); diff --git a/src/components/PostFormButtons.js b/src/components/PostFormButtons.js index 0cd5709..e731c62 100644 --- a/src/components/PostFormButtons.js +++ b/src/components/PostFormButtons.js @@ -1,3 +1,5 @@ +import React from "react"; + const PostFormButtons = (props) => { const handleClickCancel = (e) => { e.preventDefault(); diff --git a/src/components/PostList.js b/src/components/PostList.js index 1eac0b1..da5f4ea 100644 --- a/src/components/PostList.js +++ b/src/components/PostList.js @@ -1,6 +1,6 @@ import uniqid from "uniqid"; -import { useState, useEffect } from "react"; +import React, { useState, useEffect } from "react"; import AuthService from "../services/auth.service"; import UserService from "../services/user.service"; diff --git a/src/components/PostListItem.js b/src/components/PostListItem.js index 7312851..8824c32 100644 --- a/src/components/PostListItem.js +++ b/src/components/PostListItem.js @@ -1,4 +1,4 @@ -import { useState, useEffect } from "react"; +import React, { useState, useEffect } from "react"; import Switch from "react-switch"; import AuthService from "../services/auth.service"; diff --git a/src/components/PostUpdate.js b/src/components/PostUpdate.js index 586094a..75e72de 100644 --- a/src/components/PostUpdate.js +++ b/src/components/PostUpdate.js @@ -1,4 +1,4 @@ -import { useState, useEffect } from "react"; +import React, { useState, useEffect } from "react"; import { useParams } from "react-router-dom"; import PostForm from "./PostForm";