Fix console warnings
This commit is contained in:
parent
71c85a26e2
commit
17da032e02
File diff suppressed because one or more lines are too long
@ -1,4 +1,3 @@
|
|||||||
import react from 'react'
|
|
||||||
import * as BS from 'react-bootstrap'
|
import * as BS from 'react-bootstrap'
|
||||||
|
|
||||||
export default function Navigation() {
|
export default function Navigation() {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState, useCallBack } from 'react';
|
||||||
import * as BS from 'react-bootstrap'
|
import * as BS from 'react-bootstrap'
|
||||||
import Popup from 'reactjs-popup';
|
import Popup from 'reactjs-popup';
|
||||||
import 'reactjs-popup/dist/index.css';
|
import 'reactjs-popup/dist/index.css';
|
||||||
@ -35,15 +35,7 @@ export default function Memberlist(props) {
|
|||||||
|
|
||||||
const {register, handleSubmit} = useForm();
|
const {register, handleSubmit} = useForm();
|
||||||
|
|
||||||
useEffect(() => {
|
const fetchMembers = useCallBack( () => {
|
||||||
fetchMembers();
|
|
||||||
}, [userId, newMember])
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
autosize(document.querySelector('textarea'));
|
|
||||||
})
|
|
||||||
|
|
||||||
function fetchMembers() {
|
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
setIsError(false);
|
setIsError(false);
|
||||||
|
|
||||||
@ -53,7 +45,7 @@ export default function Memberlist(props) {
|
|||||||
'Authorization': JSON.stringify(localStorage.getItem("token")).slice(1, -1)
|
'Authorization': JSON.stringify(localStorage.getItem("token")).slice(1, -1)
|
||||||
}}).then ( res => res.json()
|
}}).then ( res => res.json()
|
||||||
).then (data => {
|
).then (data => {
|
||||||
{ newMember ? setMembers([...data, newMember]) : setMembers(data)}
|
newMember ? setMembers([...data, newMember]) : setMembers(data)
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
})
|
})
|
||||||
.catch (error => {
|
.catch (error => {
|
||||||
@ -61,7 +53,15 @@ export default function Memberlist(props) {
|
|||||||
setIsError(true);
|
setIsError(true);
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
})
|
})
|
||||||
}
|
}, [newMember, userId])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
fetchMembers();
|
||||||
|
}, [fetchMembers])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
autosize(document.querySelector('textarea'));
|
||||||
|
})
|
||||||
|
|
||||||
function addProxyField() {
|
function addProxyField() {
|
||||||
setProxyTags(oldTags => [...oldTags, {prefix: '', suffix: ''}] )
|
setProxyTags(oldTags => [...oldTags, {prefix: '', suffix: ''}] )
|
||||||
|
Loading…
Reference in New Issue
Block a user