8000 GitHub - thheller/react-router-cljs: example app using react-router with reagent and shadow-cljs
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

thheller/react-router-cljs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-router-dom example ported to CLJS using reagent + shadow-cljs.

https://reacttraining.com/react-router/web/guides/quick-start

import React from "react";
import { BrowserRouter as Router, Route, Link } from "react-router-dom";

function Index() {
  return <h2>Home</h2>;
}

function About() {
  return <h2>About</h2>;
}

function Users() {
  return <h2>Users</h2>;
}

function AppRouter() {
  return (
    <Router>
      <div>
        <nav>
          <ul>
            <li>
              <Link to="/">Home</Link>
            </li>
            <li>
              <Link to="/about/">About</Link>
            </li>
            <li>
              <Link to="/users/">Users</Link>
            </li>
          </ul>
        </nav>

        <Route path="/" exact component={Index} />
        <Route path="/about/" component={About} />
        <Route path="/users/" component={Users} />
      </div>
    </Router>
  );
}

After cloning this repo

npm install
npx shadow-cljs watch app

When compilation finishes open http://localhost:9400 in your browser.

About

example app using react-router with reagent and shadow-cljs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0