File: examples/react/src/App-WithEffect.js

Recommend this page to a friend!
  Classes of Arturs Sosins  >  Countly Web SDK  >  examples/react/src/App-WithEffect.js  >  Download  
File: examples/react/src/App-WithEffect.js
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Countly Web SDK
Track site accesses and errors the Countly API
Author: By
Last change:
Date: 2 months ago
Size: 1,071 bytes


Class file image Download
import React, { useState } from "react";
import { BrowserRouter as Router, Switch, Route } from "react-router-dom";

import Home from "./Components/Home";
import Contact from "./Components/Contact";
import Header from "./Components/Header";

import Location from "./Location-WithEffect";
import ErrorBoundary from "./ErrorBoundary";

const App = () => {
    const [loginState, setLoginState] = useState(localStorage.getItem("clydemo-login-state") ? true : false);

    return (
        <Router basename={`${process.env.PUBLIC_URL}`}>
                    <Header loginState={loginState} setLoginState={setLoginState} />
                        <Route path="/contact">
                            <Contact />
                        <Route path="/">
                            <Home />

export default App;