How to use the wouter.useLocation function in wouter

To help you get started, we’ve selected a few wouter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cedeber / web-client-boilerplate / src / App.tsx View on Github external
export default function App() {
    const [location] = useLocation();
    const [state, dispatch] = useReducer(reducer, initialState);

    return (
        
            <header>
                
            </header>
            <main>
                <p>Current location: {location}</p>
                }&gt;
                    </main>
github bmcmahen / julienne / src / RecipeList.tsx View on Github external
export function RecipeListItem({ recipe, id, highlight }: RecipeListItemProps) {
  const theme = useTheme();
  const { src, error } = useFirebaseImage("thumb-sm@", recipe.image);
  const href = `/${id}`;
  const [isActive] = useRoute(href);
  const [, setLocation] = useLocation();

  return (
     {
        e.preventDefault();
        setLocation(href);
      }}
      aria-current={isActive}
      href={`/${id}`}
      css={{
        paddingTop: 0,
        paddingBottom: 0,
        height: "56px",
        alignItems: "center",
        display: "flex",
github cedeber / web-client-boilerplate / shell_app / views.tsx View on Github external
export function NavigationBar() {
    const [location, setLocation] = useLocation();

    const goto = useCallback(
        (newTabId: TabId) =&gt; {
            setLocation(String(newTabId));
        },
        [setLocation],
    );

    const searchSpinner = ;
    const navBarMenu = (
        <menu>
            <menuitem>
            <menuitem>
            <menuitem>
            
            <menuitem>} text="Settings..." /&gt;</menuitem></menuitem></menuitem></menuitem></menu>

wouter

Minimalist-friendly ~1.5KB router for React

Unlicense
Latest version published 3 months ago

Package Health Score

83 / 100
Full package analysis