Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get search params from url react

React Router Dom v6 
import { useSearchParams  } from 'react-router-dom'
//url  = http://localhost:3000/main/ride?type=send
let [searchParams, setSearchParams] = useSearchParams();
console.log(searchParams.get('type')); // send
 
PREVIOUS NEXT
Tagged: #search #params #url #react
ADD COMMENT
Topic
Name
3+3 =