frejs / fre

:ghost: Tiny Concurrent UI library with Fiber.

Home Page:https://fre.deno.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fre router

AlidotSal opened this issue · comments

I was wondering if there is a router for fre or it works with other (react) routers?

https://github.com/molefrog/wouter/blob/master/use-location.js

Here is a use-location hook that can be used.

im using this for the mean time https://socket.dev/npm/package/frontend-router-js
import router from "frontend-router-js";

  useEffect(() => {
    const routes = document.getElementById("routes");
    router.get("/", (req, res) => {
		render(<h1>HOME PAGE</h1>, routes);
    });
    router.get("/contact", (req, res) => {
        render(<h1>CONTACT US</h1>, routes);
    });
	return () => {
	}
  }, [])