KiDxS / GateKeeper

Found unnecessary fragments JS-0424
Anti-pattern
Major
a year ago2 years old
Fragments should contain more than one child - otherwise, there’s no need for a Fragment at all
 9    setTimeout(() => setLoading(false), 1500);
10  }, []);
11  return (
12    <>13      {loading ? (14        <Flex15          alignItems="center"16          justifyContent="center"17          minH="100vh"18          textAlign="center"19        >20          <Spinner color="body" bgColor="bg" verticalAlign="middle" size="xl" />21        </Flex>22      ) : (23        props.children24      )}25    </>26  );
27};
28
Fragments should contain more than one child - otherwise, there’s no need for a Fragment at all
17        setLoggedIn(false);
18        navigate("/");
19    }, [cookies, navigate]);
20    return <>{loggedIn && props.children}</>;21};
22
23export default AuthProvider;