Remove component import from functional JSX

This commit is contained in:
Nathan Barber
2021-04-07 12:11:04 -04:00
parent 6a1a4de329
commit 752d6305fd
7 changed files with 15 additions and 11 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
import React, { Component, useState } from "react";
import React, { useState } from "react";
import { Link } from "react-router-dom";
import PropTypes from "prop-types";

View File

@@ -1,4 +1,4 @@
import React, { Component, useState } from "react";
import React, { useState } from "react";
import { Link } from "react-router-dom";
import PropTypes from "prop-types";
@@ -25,6 +25,7 @@ const CreateGroup = (props) => {
id="group-name"
placeholder="group name..."
onChange={(e) => {
console.log(e.target.value);
setGroupName(e.target.value);
}}
></input>
@@ -39,7 +40,6 @@ const CreateGroup = (props) => {
id="submit"
className="btn btn-primary"
onClick={() => {
let groupName = groupName;
createGroup(groupName)
.then(refreshGroupsData())
.then(history.push("/groups"))

View File

@@ -1,4 +1,4 @@
import React, { Component, useState } from "react";
import React, { useState } from "react";
import { Link } from "react-router-dom";
import PropTypes from "prop-types";

View File

@@ -1,4 +1,4 @@
import React, { Component, useState } from "react";
import React, { useState } from "react";
import { Link } from "react-router-dom";
import Multiselect from "../Multiselect/Multiselect";
import PropTypes from "prop-types";
@@ -119,6 +119,7 @@ GroupEdit.propTypes = {
addToGroup: PropTypes.func,
removeFromGroup: PropTypes.func,
deleteGroup: PropTypes.func,
refreshGroupsData: PropTypes.func,
};
export default GroupEdit;

View File

@@ -1,4 +1,4 @@
import React, { Component } from "react";
import React from "react";
import { Link } from "react-router-dom";
import PropTypes from "prop-types";
@@ -8,7 +8,7 @@ const Groups = (props) => {
groups_data,
refreshGroupsData,
refreshUserData,
history
history,
} = props;
if (!groups_data || !user_data) {
@@ -77,6 +77,9 @@ Groups.propTypes = {
groups_data: PropTypes.array,
refreshUserData: PropTypes.func,
refreshGroupsData: PropTypes.func,
history: PropTypes.shape({
push: PropTypes.func,
}),
};
export default Groups;

File diff suppressed because one or more lines are too long