All Projects → Paratron → Hookrouter

Paratron / Hookrouter

The flexible, and fast router for react that is entirely based on hooks

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Hookrouter

Router
🛣 Simple Navigation for iOS
Stars: ✭ 438 (-63.5%)
Mutual labels:  router, navigation
React Fetching Library
Simple and powerful API client for react 👍 Use hooks or FACCs to fetch data in easy way. No dependencies! Just react under the hood.
Stars: ✭ 561 (-53.25%)
Mutual labels:  hooks, ssr
Mobx Router
A simple router for MobX + React apps
Stars: ✭ 489 (-59.25%)
Mutual labels:  hooks, router
Hamburger React
Animated hamburger menu icons for React (1.5 KB) 🍔
Stars: ✭ 391 (-67.42%)
Mutual labels:  hooks, navigation
Svelte Store Router
Store-based router for Svelte
Stars: ✭ 54 (-95.5%)
Mutual labels:  router, ssr
Relay Hooks
Use Relay as React hooks
Stars: ✭ 423 (-64.75%)
Mutual labels:  hooks, ssr
Gear
A lightweight, composable and high performance web service framework for Go.
Stars: ✭ 544 (-54.67%)
Mutual labels:  hooks, router
Trousers
hooks-first CSS-in-JS library, focused on semantics and runtime performance
Stars: ✭ 295 (-75.42%)
Mutual labels:  hooks, ssr
React 5ddm
5d动漫,使用React,服务端渲染,接口(不开源)来自赞片CMS。仅供参考,交流群:14646823 欢迎加入
Stars: ✭ 50 (-95.83%)
Mutual labels:  hooks, ssr
Flowzard
Isolates navigation from UI and Business logic with simple wizard like mechanism.
Stars: ✭ 49 (-95.92%)
Mutual labels:  router, navigation
React Uploady
Modern file uploading - components & hooks for React
Stars: ✭ 372 (-69%)
Mutual labels:  hooks, ssr
E Commerce App React Native
E-commerce App UI. React native, Expo managed flow, React navigation v5, Notification.
Stars: ✭ 61 (-94.92%)
Mutual labels:  hooks, navigation
Miox
Modern infrastructure of complex SPA
Stars: ✭ 374 (-68.83%)
Mutual labels:  router, ssr
Auto route library
Flutter route generator
Stars: ✭ 434 (-63.83%)
Mutual labels:  router, navigation
Route Composer
Protocol oriented, Cocoa UI abstractions based library that helps to handle view controllers composition, navigation and deep linking tasks in the iOS application. Can be used as the universal replacement for the Coordinator pattern.
Stars: ✭ 362 (-69.83%)
Mutual labels:  router, navigation
React Router Navigation
⛵️ A complete navigation library for React Native, React DOM and React Router
Stars: ✭ 498 (-58.5%)
Mutual labels:  router, navigation
React Native Simple Router
A community maintained router component for React Native
Stars: ✭ 266 (-77.83%)
Mutual labels:  router, navigation
Ice
🚀 The Progressive App Framework Based On React(基于 React 的渐进式应用框架)
Stars: ✭ 16,961 (+1313.42%)
Mutual labels:  hooks, ssr
Navaid
A navigation aid (aka, router) for the browser in 850 bytes~!
Stars: ✭ 648 (-46%)
Mutual labels:  router, navigation
Ng2 Breadcrumbs
A breadcrumb service for the Angular 7 router
Stars: ✭ 61 (-94.92%)
Mutual labels:  router, navigation

React Hook Router

The modern alternative to react-router.

Tested from React 16.8.1 upwards.

How to install

Well, this is straightforward:

npm i hookrouter

Typescript

This project is not and will not be written in typescript.

Thanks to the github user @mcaneris, you can install types via:

npm i @types/hookrouter

I did not check if those types are correct nor will I keep them up to date with future releases.

Documentation

Detailed documentation about how to use hookrouter can be found here

A quick example

import {useRoutes} from 'hookrouter';

const routes = {
    '/': () => <HomePage />,
    '/about': () => <AboutPage />,
    '/products': () => <ProductOverview />,
    '/products/:id': ({id}) => <ProductDetails id={id} />
};
	
const MyApp = () => {
    const routeResult = useRoutes(routes);
    
    return routeResult || <NotFoundPage />;
}

Routes are defined as an object. Keys are the routes, which are matched against the URL, the values need to be functions that are called when a route matches. You may define placeholders in your routes with :something which will be forwarded as props to your function calls so you can distribute them to your components.

The hook will return whatever the route function returned, so you may also return strings, arrays, React fragments, null - whatever you like.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].