UNPKG

react-carousel-query

Version:

A infinite carousel component made with react that handles the pagination for you.

19 lines (18 loc) 448 B
import global from 'global'; import { parse } from 'qs'; const { document } = global; export const getQueryParams = () => { // document.location is not defined in react-native if (document && document.location && document.location.search) { return parse(document.location.search, { ignoreQueryPrefix: true }); } return {}; }; export const getQueryParam = key => { const params = getQueryParams(); return params[key]; };