0.4.0 • Published 21 days ago

@alpakaslab/nextjs-search-router v0.4.0

Weekly downloads
-
License
MIT
Repository
-
Last release
21 days ago

⭐️ About

NextJs Search Router is a library built for the NextJs 13 ecosystem, focused on helping create complex routes. The main objective is to be able to work with search routes, usually related to eCommerce, in a simpler way using react hooks.

🚀 Getting Started

Install using an package manager

pnpm add @alpakaslab/nextjs-search-router
# or
yarn add @alpakaslab/nextjs-search-router
# or
npm install @alpakaslab/nextjs-search-router

🧩 Using Component

import { useSearchRouter } from '@alpakaslab/nextjs-search-router'

const Page = () => {
    const {...} = useSearchRouter({ baseUrl: 'http://localhost:3000/' })

    return <></>
}

export default Page;

🔨 Hook Functions

addRouteParam() - This function receives a key and a value as a parameter and adds it to the url, if the key already exists in the query, it concatenates using ","

    const { addRouteParam } = useSearchRouter()

    return (
        <button onClick={()=>addRouteParam("id",1)}>
            Filter by ID
        </button>
    )
0.4.0

21 days ago

0.3.9

3 months ago

0.3.10

3 months ago

0.3.0

3 months ago

0.3.6

3 months ago

0.3.5

3 months ago

0.3.8

3 months ago

0.3.7

3 months ago

0.3.2

3 months ago

0.3.1

3 months ago

0.3.4

3 months ago

0.3.3

3 months ago

0.2.0

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago