The message I have while trying to import queryString is "Could not find a declaration file for module ‘query-string’ ".
I installed npm i [email protected] and that didn’t work. Next I tried npm install @types/query-string and that didn’t work either.
Any suggestions???
Here’s my code:
import React from “react”;
import queryString from ‘query-string’;
const Posts = ({ match, location }) => {
const result = queryString.parse(location.search);
console.log(result);
return (
<div>
<h1>Posts</h1>
Year: { match.params.year } , Month: { match.params.month}
</div>
);
};
export default Posts;