Example Button Component
npm install parse-url-query-params
  
react-window-dimensions-hook will helps to get window / viewPort width or window / viewPort height . ``bash`
npm i parse-url-query-params -S
Just import the parseQueryParameters component from parse-url-query-params
`javascript
import parseQueryParameters from 'parse-url-query-params';
const prsedUrl = parseQueryParameters('http://localhost:3000/offers?offerID=1231sfwf21&local=FR');
console.log(prsedUrl)
`
OutPut ::
`javascript`
{
"offerID":"1231sfwf21",
"local":"FR"
}
In destrction way...
Just import the parseQueryParameters component from parse-url-query-params
`javascript
import parseQueryParameters from 'parse-url-query-params';
const { offerID, local } = parseQueryParameters('http://localhost:3000/offers?offerID=1231sfwf21&local=FR');
console.log('offerID');
console.log(offerID);
console.log('local');
console.log(local);
`
OutPut ::
`javascript
offerID
"1231sfwf21"
local
"FR"
``
or visit https://dvyogesh.github.io/lerna-starter/?path=/ story/design-system-parsequeryparameters--parse-query-parameters
MIT