Horje
get data from mulitple query parameters react Code Example
get data from mulitple query parameters react
import React from 'react';
import {useLocation} from "react-router-dom";

export default function Items() {
 //Where parameter url = localhost:3000/items?name=pen&id=12
  const search = useLocation().search;
  const name = new URLSearchParams(search).get('name');  const id = new URLSearchParams(search).get('id');
  return (
    <div>
      <h1>Items page</h1>
      <p>{id}</p>      <p>{name}</p>    </div>
  );
}
Source: reactgo.com




Javascript

Related
react image compression Code Example react image compression Code Example
javascript recursive on object of arrays Code Example javascript recursive on object of arrays Code Example
join two arrays in js Code Example join two arrays in js Code Example
append to a div and save the previous data after refresh page  in javascript Code Example append to a div and save the previous data after refresh page in javascript Code Example
column chart in js Code Example column chart in js Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10