Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Add Navbar to React Redux CRUD App

import React, { Component } from "react";
import { BrowserRouter as Router, Switch, Route, Link } from "react-router-dom";
import "bootstrap/dist/css/bootstrap.min.css";
import "./App.css";

import AddTutorial from "./components/add-tutorial.component";
import Tutorial from "./components/tutorial.component";
import TutorialsList from "./components/tutorials-list.component";

class App extends Component {
  render() {
    return (
      <Router>
        <nav className="navbar navbar-expand navbar-dark bg-dark">
          <Link to={"/tutorials"} className="navbar-brand">
            bezKoder
          </Link>
          <div className="navbar-nav mr-auto">
            <li className="nav-item">
              <Link to={"/tutorials"} className="nav-link">
                Tutorials
              </Link>
            </li>
            <li className="nav-item">
              <Link to={"/add"} className="nav-link">
                Add
              </Link>
            </li>
          </div>
        </nav>

        <div className="container mt-3">
          <Switch>
            <Route exact path={["/", "/tutorials"]} component={TutorialsList} />
            <Route exact path="/add" component={AddTutorial} />
            <Route path="/tutorials/:id" component={Tutorial} />
          </Switch>
        </div>
      </Router>
    );
  }
}

export default App;
Comment

PREVIOUS NEXT
Code Example
Javascript :: destructring global state at one place 
Javascript :: Kontol Javascript 
Javascript :: undo pwa 
Javascript :: jquery scroll to top of element 
Javascript :: Pausing setInterval when page/ browser is out of focus 
Javascript :: parse curency 
Javascript :: reduceat 
Javascript :: Reactjs exemple function component 
Javascript :: javascript how to multiply numbers 
Javascript :: scriptable alert 
Javascript :: js import 
Javascript :: Access the list of valid values for an Enum field in a MongoDb Mongoose Schema 
Javascript :: javascript centuries 
Javascript :: save canvas from console 
Javascript :: how to empty nodeList 
Javascript :: IIFE module pattern in javascript 
Javascript :: taylors javascript test 
Javascript :: animated progress bar cdn 
Javascript :: loose and strict equality 
Javascript :: react native paper touchable ripple 
Javascript :: how to merge data rn 
Javascript :: append to a div and save the previous data after refresh page in javascript 
Javascript :: Javascript Class expressions 
Javascript :: javascript activate file input 
Javascript :: getelementsbyclassname angular 
Javascript :: tekenaja 
Javascript :: js set to array casting 
Javascript :: get all keys of nested object json data javascript 
Javascript :: Pass Props to a Component Using Short circuit evaluation in react 
Javascript :: pass props to svg 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =