1.0.16 • Published 2 years ago

react-search-query v1.0.16

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

React Search Query

A lightweight library for working with search queries in react

React search query allows you to get the search params in the URL with a single line of code.

Installation

React-search-query requires a window to run. If you're using a Next application, wrap the method in useEffect.

yarn add react-search-query
yarn start

npm install react-search query
npm start

Usage

To use react-search-query in a react application, import the package and initialise:

import { Query } from "react-search-query"

const App = () => {
    const query = Query()
    console.log(query)
}

To use react-search-query in a next application, import the package and intiailise in useEffect:

import { Query } from "react-search-query"
import { useState, useEffect } from "react"

const App = () => {
    const [state, setState] = useState({})

    useEffect(() => {
        const query = Query()
        setState(query)
    }, [])

    console.log(state)
}

Repository

Check out the public repository here

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.4

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago